<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, String encoding) throws IOException { | |
InputStreamReader reader; | |
try { | |
if (encoding == null) { | |
reader = new FileReader(fileUrl); | |
} else { | |
reader = new InputStreamReader(new FileInputStream(fileUrl),encoding); | |
} | |
} | |
catch (FileNotFoundException e) { | |
// try a real URL instead | |
URL url = new URL(fileUrl); | |
if (encoding == null) { | |
reader = new InputStreamReader (url.openStream()); | |
} else { | |
reader = new InputStreamReader (url.openStream(), encoding); | |
} | |
} | |
return new BufferedReader(reader); | |
} | |
StringBuffer sb = new StringBuffer(4000); | |
if (encoding == void) { | |
encoding = null; | |
} | |
BufferedReader in = getReader(fileurl, encoding); | |
String str; | |
String lineEnding = System.getProperty("line.separator"); | |
while ((str = in.readLine()) != null) { | |
sb.append(str); | |
sb.append(lineEnding); | |
} | |
in.close(); | |
filecontents = sb.toString(); | |
</script> | |
<dependencies /> | |
<inputs> | |
<net.sf.taverna.t2.workflowmodel.processor.activity.config.ActivityInputPortDefinitionBean> | |
<handledReferenceSchemes /> | |
<translatedElementType>java.lang.String</translatedElementType> | |
<allowsLiteralValues>true</allowsLiteralValues> | |
<name>fileurl</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>encoding</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>filecontents</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> |