<activity xmlns="http://taverna.sf.net/2008/xml/t2flow"><class>net.sf.taverna.t2.activities.localworker.LocalworkerActivity</class><inputMap /><outputMap /><configBean encoding="xstream"><net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean xmlns=""> | |
<script>BufferedReader getReader (String fileUrl) throws IOException { | |
InputStreamReader reader; | |
try { | |
reader = new FileReader(fileUrl); | |
} | |
catch (FileNotFoundException e) { | |
// try a real URL instead | |
URL url = new URL(fileUrl); | |
reader = new InputStreamReader (url.openStream()); | |
} | |
return new BufferedReader(reader); | |
} | |
String NEWLINE = System.getProperty("line.separator"); | |
boolean displayResults = false; | |
if (displayresults != void) { | |
displayResults = Boolean.valueOf(displayresults).booleanValue(); | |
} | |
StringBuffer sb = new StringBuffer(2000); | |
if (outputfile == void) { | |
throw new RuntimeException("The 'outputfile' parameter cannot be null"); | |
} | |
if (filelist == null) { | |
throw new RuntimeException("The 'filelist' parameter cannot be null"); | |
} | |
String str = null; | |
Writer writer = new FileWriter(outputfile); | |
for (int i = 0; i < filelist.size(); i++) { | |
BufferedReader reader = getReader(filelist.get(i)); | |
while ((str = reader.readLine()) != null) { | |
writer.write(str); | |
writer.write(NEWLINE); | |
if (displayResults) { | |
sb.append(str); | |
sb.append(NEWLINE); | |
} | |
} | |
reader.close(); | |
} | |
writer.flush(); | |
writer.close(); | |
if (displayResults) { | |
results= sb.toString(); | |
} | |
</script> | |
<dependencies /> | |
<inputs> | |
<net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean> | |
<handledReferenceSchemes /> | |
<translatedElementType>java.lang.String</translatedElementType> | |
<allowsLiteralValues>true</allowsLiteralValues> | |
<name>filelist</name> | |
<depth>1</depth> | |
<mimeTypes> | |
<string>l('text/plain')</string> | |
</mimeTypes> | |
</net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean> | |
<net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean> | |
<handledReferenceSchemes /> | |
<translatedElementType>java.lang.String</translatedElementType> | |
<allowsLiteralValues>true</allowsLiteralValues> | |
<name>outputfile</name> | |
<depth>0</depth> | |
<mimeTypes> | |
<string>'text/plain'</string> | |
</mimeTypes> | |
</net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean> | |
<net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean> | |
<handledReferenceSchemes /> | |
<translatedElementType>java.lang.String</translatedElementType> | |
<allowsLiteralValues>true</allowsLiteralValues> | |
<name>displayresults</name> | |
<depth>0</depth> | |
<mimeTypes> | |
<string>'text/plain'</string> | |
</mimeTypes> | |
</net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean> | |
</inputs> | |
<outputs> | |
<net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean> | |
<granularDepth>0</granularDepth> | |
<name>results</name> | |
<depth>0</depth> | |
<mimeTypes> | |
<string>'text/plain'</string> | |
</mimeTypes> | |
</net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityOutputPortDefinitionBean> | |
</outputs> | |
</net.sf.taverna.t2.activities.localworker.LocalworkerActivityConfigurationBean></configBean></activity> |