blob: 0c3265d4e1a0cb6070cc31e72a54cec47089a0d5 [file] [log] [blame]
{
"http://purl.org/dc/terms/rights": "Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You 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.",
"http://purl.org/dc/terms/license": {"@id": "http://www.apache.org/licenses/LICENSE-2.0"},
"classLoaderSharing" : "workflow",
"script" : "BufferedReader getReader (String fileUrl) throws IOException {\n\t\tInputStreamReader reader;\n\t\ttry {\n\t\t\treader = new FileReader(fileUrl);\n\t\t}\n\t\tcatch (FileNotFoundException e) {\n\t\t\t// try a real URL instead\n\t\t\tURL url = new URL(fileUrl);\n\t\t\treader = new InputStreamReader (url.openStream());\n\t\t}\n\t\treturn new BufferedReader(reader);\n\t}\n\nString NEWLINE = System.getProperty(\"line.separator\");\n\nboolean displayResults = false;\nif (displayresults != void) {\n\tdisplayResults = Boolean.valueOf(displayresults).booleanValue();\n}\n\nStringBuffer sb = new StringBuffer(2000);\n\nif (outputfile == void) {\n\tthrow new RuntimeException(\"The 'outputfile' parameter cannot be null\");\n}\n\nif (filelist == null) {\n\tthrow new RuntimeException(\"The 'filelist' parameter cannot be null\");\n}\n\nString str = null;\n\nWriter writer = new FileWriter(outputfile);\nfor (int i = 0; i < filelist.size(); i++) {\n\tBufferedReader reader = getReader(filelist.get(i));\n\twhile ((str = reader.readLine()) != null) {\n\t\twriter.write(str);\n\t\twriter.write(NEWLINE);\n\n\t\tif (displayResults) {\n\t\t\tsb.append(str);\n\t\t\tsb.append(NEWLINE);\n\t\t}\n\t}\n\n\treader.close();\n\n}\nwriter.flush();\nwriter.close();\n\nif (displayResults) {\n\tresults= sb.toString();\n}\n\n",
"localworkerName" : "net.sourceforge.taverna.scuflworkers.io.ConcatenateFileListWorker",
"inputPorts" : [ {
"name" : "filelist",
"depth" : 1,
"type" : "String"
}, {
"name" : "outputfile",
"depth" : 0,
"type" : "String"
}, {
"name" : "displayresults",
"depth" : 0,
"type" : "String"
} ],
"outputPorts" : [ {
"name" : "results",
"depth" : 0,
"granularDepth" : 0
} ],
"isAltered" : false
}