mirror of https://github.com/micromata/borgbackup-butler.git

Kai Reinhard
28.55.2018 60f6fbc31679a112958db1fbecc62e8195b127f6
borgbutler-core/src/main/java/de/micromata/borgbutler/jobs/AbstractCommandLineJob.java
@@ -1,5 +1,6 @@
package de.micromata.borgbutler.jobs;
import de.micromata.borgbutler.config.Definitions;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.exec.*;
@@ -11,7 +12,6 @@
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Map;
/**
@@ -32,6 +32,8 @@
    private File workingDirectory;
    @Setter
    private String description;
    protected ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    protected ByteArrayOutputStream errorOutputStream = new ByteArrayOutputStream();
    protected abstract CommandLine buildCommandLine();
@@ -53,8 +55,6 @@
    @Override
    public String execute() {
        getCommandLineAsString();
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        ByteArrayOutputStream errorOutputStream = new ByteArrayOutputStream();
        DefaultExecutor executor = new DefaultExecutor();
        if (workingDirectory != null) {
            executor.setWorkingDirectory(workingDirectory);
@@ -100,7 +100,7 @@
            failed();
            afterFailure(ex);
        }
        return outputStream.toString(Charset.forName("UTF-8"));
        return outputStream.toString(Definitions.STD_CHARSET);
    }
    @Override