Search in sources :

Example 1 with MergeTo

use of com.devonfw.cobigen.api.externalprocess.to.MergeTo in project cobigen by devonfw.

the class ExternalServerMergerProxy method merge.

@Override
public String merge(File base, String patch, String targetCharset) throws MergeException {
    String baseFileContents;
    try {
        baseFileContents = new String(Files.readAllBytes(base.toPath()), Charset.forName(targetCharset));
    } catch (IOException e) {
        throw new MergeException(base, "Could not read base file!", e);
    }
    MergeTo mergeTo = new MergeTo(baseFileContents, patch, this.patchOverrides);
    return this.externalProcess.postJsonRequest("merge", mergeTo);
}
Also used : MergeTo(com.devonfw.cobigen.api.externalprocess.to.MergeTo) MergeException(com.devonfw.cobigen.api.exception.MergeException) IOException(java.io.IOException)

Aggregations

MergeException (com.devonfw.cobigen.api.exception.MergeException)1 MergeTo (com.devonfw.cobigen.api.externalprocess.to.MergeTo)1 IOException (java.io.IOException)1