Read text file
Created: 2010-10-28 16:33:35
The beanshell write the string 'hello' to a temporary file. The filepath to the temporary file is then passed to the Read_text_file service which reads the file and outputs the string 'hello'.
Preview
Run
Run this Workflow in the Taverna Workbench...
Workflow Components
Authors (1)
Titles (3)
Read text file |
Read text file |
Read text file |
Descriptions (1)
The beanshell write the string 'hello' to a temporary file. The filepath to the temporary file is then passed to the Read_text_file service which reads the file and outputs the string 'hello'. |
Dependencies (0)
Processors (3)
Name |
Type |
Description |
Read_Text_File |
localworker |
ScriptBufferedReader 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);
}
StringBuffer sb = new StringBuffer(4000);
BufferedReader in = getReader(fileurl);
String str;
String lineEnding = System.getProperty("line.separator");
while ((str = in.readLine()) != null) {
sb.append(str);
sb.append(lineEnding);
}
in.close();
filecontents = sb.toString();
|
Create_and_populate_temporary_file |
beanshell |
ScriptFile temp = File.createTempFile("taverna", "txt");
temp.deleteOnExit();
BufferedWriter writer = new BufferedWriter(new FileWriter(temp));
writer.write(content);
writer.close();
out = temp.getCanonicalPath(); |
hello |
stringconstant |
Valuehello |
Beanshells (1)
Name |
Description |
Inputs |
Outputs |
Create_and_populate_temporary_file |
|
content
|
out
|
Outputs (1)
Name |
Description |
file_contents |
|
Datalinks (3)
Source |
Sink |
Create_and_populate_temporary_file:out |
Read_Text_File:fileurl |
hello:value |
Create_and_populate_temporary_file:content |
Read_Text_File:filecontents |
file_contents |
Uploader
License
All versions of this Workflow are
licensed under:
Version 1
(of 1)
Credits (0)
(People/Groups)
None
Attributions (0)
(Workflows/Files)
None
Shared with Groups (1)
Featured In Packs (0)
None
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