X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.simple%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2Ftasks%2FEcho.java;fp=runtime%2Forg.argeo.slc.support.simple%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2Ftasks%2FEcho.java;h=0000000000000000000000000000000000000000;hb=ee6c3543a0ff9403420ce6a9c647723269f14331;hp=07ec879aa2b15c6192118d2a5f8758664896493f;hpb=9daa55ce316d52ffd8f30dc0d1b516ccf78a8c73;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/tasks/Echo.java b/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/tasks/Echo.java deleted file mode 100644 index 07ec879aa..000000000 --- a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/tasks/Echo.java +++ /dev/null @@ -1,50 +0,0 @@ -package org.argeo.slc.core.execution.tasks; - -import java.io.File; -import java.io.IOException; - -import org.apache.commons.io.FileUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.argeo.slc.SlcException; -import org.springframework.core.io.Resource; - -public class Echo implements Runnable { - private final static Log defaultLog = LogFactory.getLog(Echo.class); - private Resource writeTo = null; - - private Log log; - private String message; - - public void run() { - log().info(message); - - if (writeTo != null) { - try { - File file = writeTo.getFile(); - if (log().isDebugEnabled()) - log().debug("Write to " + file); - FileUtils.writeStringToFile(file, message); - } catch (IOException e) { - throw new SlcException("Could not write to " + writeTo, e); - } - } - } - - protected Log log() { - return log != null ? log : defaultLog; - } - - public void setLog(Log log) { - this.log = log; - } - - public void setMessage(String message) { - this.message = message; - } - - public void setWriteTo(Resource writeTo) { - this.writeTo = writeTo; - } - -}