blob: ad7a5b682600c0424bd3afbd2234dffca28cefa1 [file] [log] [blame]
{
"classLoaderSharing" : "workflow",
"script" : "if ((url == void) || (url == null)) {\n\tthrow new RuntimeException(\"The url must be specified\");\n}\n\nURL inputURL = null;\nif (base != void) {\n inputURL = new URL(new URL(base), url);\n}\nelse {\n inputURL = new URL(url);\n}\nURLConnection con = inputURL.openConnection();\nInputStream in = con.getInputStream();\n\nStringBuffer result = new StringBuffer();\nBufferedReader reader;\n\nString encoding = con.getContentEncoding();\nif (encoding == null) {\n reader = new BufferedReader(new InputStreamReader(in));\n} else {\n reader = new BufferedReader(new InputStreamReader(in, encoding));\n}\nString line = null;\nString NEWLINE = System.getProperty(\"line.separator\");\nwhile ((line = reader.readLine()) != null) {\n\tresult.append(line);\n\tresult.append(NEWLINE);\n}\n\nreader.close();\ncontents = result.toString();\n",
"localworkerName" : "org.embl.ebi.escience.scuflworkers.java.WebPageFetcher",
"inputPorts" : [ {
"name" : "url",
"depth" : 0,
"type" : "String"
}, {
"name" : "base",
"depth" : 0,
"type" : "String"
} ],
"outputPorts" : [ {
"name" : "contents",
"depth" : 0,
"granularDepth" : 0
} ],
"isAltered" : false
}