]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.specs/src/main/java/org/argeo/slc/process/SlcExecutionStep.java
Add license headers
[gpl/argeo-slc.git] / runtime / org.argeo.slc.specs / src / main / java / org / argeo / slc / process / SlcExecutionStep.java
index 5c54b2c6d9c5a0c8498a918fdeb4553917e0cad9..235b617e500f75cd6d95ae1265a86b4325eb1c68 100644 (file)
@@ -1,14 +1,27 @@
+/*\r
+ * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ *         http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
 package org.argeo.slc.process;\r
 \r
-import java.io.IOException;\r
-import java.io.StringReader;\r
 import java.util.ArrayList;\r
 import java.util.Date;\r
 import java.util.List;\r
+import java.util.StringTokenizer;\r
 import java.util.UUID;\r
 \r
-import org.apache.commons.io.IOUtils;\r
-\r
 public class SlcExecutionStep {\r
        public final static String TYPE_START = "START";\r
        public final static String TYPE_END = "END";\r
@@ -68,17 +81,13 @@ public class SlcExecutionStep {
                this.logLines = logLines;\r
        }\r
 \r
-       @SuppressWarnings(value = { "unchecked" })\r
        public void addLog(String log) {\r
                if (log == null)\r
                        return;\r
 \r
-               try {\r
-                       List<String> lines = IOUtils.readLines(new StringReader(log));\r
-                       logLines.addAll(lines);\r
-               } catch (IOException e) {\r
-                       throw new RuntimeException("Cannot add log", e);\r
-               }\r
+               StringTokenizer st = new StringTokenizer(log, "\n");\r
+               while (st.hasMoreTokens())\r
+                       logLines.add(st.nextToken());\r
        }\r
 \r
        @Override\r