Example for external tools with zip and unzip
Created: 2014-04-03 09:51:21
This workflow only works on a Unix machine.
This workflow takes a fixed URL from which a text file is downloaded (output as Original_file). That file is zipped (output as Zipped_File) and then unzipped again (output as Unzipped_File). The orginal file and the unzipped version are then diff'd/
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Steffen Moeller
Alan Williams |
Titles (1)
Example for external tools with zip and unzip |
Descriptions (1)
This workflow only works on a Unix machine.
This workflow takes a fixed URL from which a text file is downloaded (output as Original_file). That file is zipped (output as Zipped_File) and then unzipped again (output as Unzipped_File). The orginal file and the unzipped version are then diff'd/
|
Dependencies (0)
Processors (5)
Name |
Type |
Description |
zip |
externaltool |
|
unzip |
externaltool |
|
Get_Web_Page_from_URL |
localworker |
Scriptif ((url == void) || (url == null)) {
throw new RuntimeException("The url must be specified");
}
URL inputURL = null;
if (base != void) {
inputURL = new URL(new URL(base), url);
}
else {
inputURL = new URL(url);
}
URLConnection con = inputURL.openConnection();
InputStream in = con.getInputStream();
StringBuffer result = new StringBuffer();
BufferedReader reader;
String encoding = con.getContentEncoding();
if (encoding == null) {
reader = new BufferedReader(new InputStreamReader(in));
} else {
reader = new BufferedReader(new InputStreamReader(in, encoding));
}
String line = null;
String NEWLINE = System.getProperty("line.separator");
while ((line = reader.readLine()) != null) {
result.append(line);
result.append(NEWLINE);
}
reader.close();
contents = result.toString();
|
url_value |
stringconstant |
Valuehttp://www.myexperiment.org/files/135/download/franck.txt |
diff |
externaltool |
|
Outputs (9)
Name |
Description |
Original_File |
Parameter file for GROMACS downloaded directly from http://md.chem.rug.nl/~mdcourse/minim.mdp
Any file would do for this example.
|
Unzipped_File |
The compressed file is uncompressed again.
|
unzip_STDERR |
Empty if executing normally.
|
unzip_STDOUT |
Always empty.
|
zip_STDERR |
Empty if executing normally.
|
zip_STDOUT |
Always empty.
|
diff_STDERR |
|
diff_STDOUT |
|
Zipped_file |
|
Datalinks (14)
Source |
Sink |
Get_Web_Page_from_URL:contents |
zip:file_to_zip |
zip:zipped_file |
unzip:zipped_file |
url_value:value |
Get_Web_Page_from_URL:url |
Get_Web_Page_from_URL:contents |
diff:file1 |
unzip:unzipped_file |
diff:file2 |
Get_Web_Page_from_URL:contents |
Original_File |
unzip:unzipped_file |
Unzipped_File |
unzip:STDERR |
unzip_STDERR |
unzip:STDOUT |
unzip_STDOUT |
zip:STDERR |
zip_STDERR |
zip:STDOUT |
zip_STDOUT |
diff:STDERR |
diff_STDERR |
diff:STDOUT |
diff_STDOUT |
zip:zipped_file |
Zipped_file |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1
(of 1)
Credits (1)
(People/Groups)
Attributions (0)
(Workflows/Files)
None
Shared with Groups (1)
Featured In Packs (4)
Log in to add to one of your Packs
Attributed By (0)
(Workflows/Files)
None
Favourited By (0)
No one
Statistics
Other workflows that use similar services
(0)
There are no workflows in myExperiment that use similar services to this Workflow.
Comments (0)
No comments yet
Log in to make a comment