org.embl.ebi.escience.scuflworkers.java
Class ReadFilesFromDirectory

java.lang.Object
  extended by org.embl.ebi.escience.scuflworkers.java.ReadFilesFromDirectory
All Implemented Interfaces:
LocalWorker

public class ReadFilesFromDirectory
extends java.lang.Object
implements LocalWorker

Consumes a directory name and an optional file suffix and returns a list of strings/bytes representing the contents of those files. If a file suffix is not specified, then all files in the directory are read.

Author:
Edward Kawas

Field Summary
 
Fields inherited from interface org.embl.ebi.escience.scuflworkers.java.LocalWorker
BINARY, BINARY_ARRAY, HTML, HTML_ARRAY, PNG_IMAGE, PNG_IMAGE_ARRAY, STRING, STRING_ARRAY, UNTYPED, UNTYPED_ARRAY
 
Constructor Summary
ReadFilesFromDirectory()
           
 
Method Summary
 java.util.Map<java.lang.String,DataThing> execute(java.util.Map inputs)
          Perform the task; take the directory path and the file suffix and get all the files in that directory
 java.lang.String[] inputNames()
          Get an array of the names of input ports for this processor
 java.lang.String[] inputTypes()
          Get an array of the string types for the inputs defined by the inputNames() method, these should probably use the constants defined in this interface but may use any valid Baclava data type specifier.
 java.lang.String[] outputNames()
          Names of the output ports
 java.lang.String[] outputTypes()
          Types of the output ports
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadFilesFromDirectory

public ReadFilesFromDirectory()
Method Detail

inputNames

public java.lang.String[] inputNames()
Description copied from interface: LocalWorker
Get an array of the names of input ports for this processor

Specified by:
inputNames in interface LocalWorker

inputTypes

public java.lang.String[] inputTypes()
Description copied from interface: LocalWorker
Get an array of the string types for the inputs defined by the inputNames() method, these should probably use the constants defined in this interface but may use any valid Baclava data type specifier.

Specified by:
inputTypes in interface LocalWorker

outputNames

public java.lang.String[] outputNames()
Description copied from interface: LocalWorker
Names of the output ports

Specified by:
outputNames in interface LocalWorker

outputTypes

public java.lang.String[] outputTypes()
Description copied from interface: LocalWorker
Types of the output ports

Specified by:
outputTypes in interface LocalWorker

execute

public java.util.Map<java.lang.String,DataThing> execute(java.util.Map inputs)
                                                  throws TaskExecutionException
Perform the task; take the directory path and the file suffix and get all the files in that directory

Specified by:
execute in interface LocalWorker
Throws:
TaskExecutionException - thrown if there is an error during invocation of the task.