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