Search in sources :

Example 1 with MuleFourApplication

use of com.mulesoft.tools.migration.engine.project.structure.mule.four.MuleFourApplication in project mule-migration-assistant by mulesoft.

the class ApplicationPersister method persistMuleArtifactJson.

private void persistMuleArtifactJson() throws IOException {
    Optional<MuleArtifactJsonModel> muleArtifactJsonModel = appModel.getMuleArtifactJsonModel();
    if (muleArtifactJsonModel.isPresent() && projectOutput instanceof MuleFourApplication) {
        String jsonContent = appModel.getMuleArtifactJsonModel().get().toString();
        File outputFile = ((MuleFourApplication) projectOutput).muleArtifactJson().toFile();
        try (FileWriter fileWriter = new FileWriter(outputFile)) {
            fileWriter.write(jsonContent);
        }
    }
}
Also used : FileWriter(java.io.FileWriter) MuleArtifactJsonModel(com.mulesoft.tools.migration.project.model.artifact.MuleArtifactJsonModel) File(java.io.File) MuleFourApplication(com.mulesoft.tools.migration.engine.project.structure.mule.four.MuleFourApplication)

Aggregations

MuleFourApplication (com.mulesoft.tools.migration.engine.project.structure.mule.four.MuleFourApplication)1 MuleArtifactJsonModel (com.mulesoft.tools.migration.project.model.artifact.MuleArtifactJsonModel)1 File (java.io.File)1 FileWriter (java.io.FileWriter)1