net.sf.filePiper.processors
Class ListFilesProcessor

java.lang.Object
  extended by net.sf.filePiper.processors.ListFilesProcessor
All Implemented Interfaces:
FileProcessor

public class ListFilesProcessor
extends Object
implements FileProcessor

Processor listing the name of the input files.

Author:
BEROL

Field Summary
 
Fields inherited from interface net.sf.filePiper.model.FileProcessor
MANY, NONE, ONE
 
Constructor Summary
ListFilesProcessor()
           
 
Method Summary
 void endBatch(FileProcessorEnvironment env)
          Notification that the current batch is finished.
 net.sf.sfac.gui.editor.ObjectEditor getEditor()
          Get a GUI editor for this object.
 int getOutputCardinality(int inputCardinality)
          Get the number of output streams generated for the given number of input streams.
 String getProcessorName()
           
 String getStatusMessage()
          Get the status of this processor to display in the status bar of the GUI during file processing.
 void init(net.sf.sfac.setting.Settings settgns)
          Initialize this file processor just after instantiation (called only once).
 void process(InputStream is, InputFileInfo info, FileProcessorEnvironment env)
          Request to process the given input stream.
 void startBatch(FileProcessorEnvironment env)
          Notification that the processing of a batch of file is starting.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListFilesProcessor

public ListFilesProcessor()
Method Detail

getProcessorName

public String getProcessorName()
Specified by:
getProcessorName in interface FileProcessor
Returns:
A displayable name for this processor.

init

public void init(net.sf.sfac.setting.Settings settgns)
Description copied from interface: FileProcessor
Initialize this file processor just after instantiation (called only once).
The settings passed here should be use to store all persistent data.

Specified by:
init in interface FileProcessor
Parameters:
settgns - Settings for this FileProcessor instance.

startBatch

public void startBatch(FileProcessorEnvironment env)
                throws IOException
Description copied from interface: FileProcessor
Notification that the processing of a batch of file is starting.
This method allows to initialize this FileProcessor before each file batch processing.

Specified by:
startBatch in interface FileProcessor
Throws:
IOException

process

public void process(InputStream is,
                    InputFileInfo info,
                    FileProcessorEnvironment env)
             throws IOException
Description copied from interface: FileProcessor
Request to process the given input stream.
The output stream to use for output should be requested to the FileProcessorEnvironment.

Specified by:
process in interface FileProcessor
Parameters:
is - the InputStream to process
info - Information about the input file to process
env - object used by this FileProcessor to interact with its environment.
Throws:
IOException - if something goes wrong.

endBatch

public void endBatch(FileProcessorEnvironment env)
              throws IOException
Description copied from interface: FileProcessor
Notification that the current batch is finished.

Specified by:
endBatch in interface FileProcessor
Throws:
IOException

getStatusMessage

public String getStatusMessage()
Description copied from interface: FileProcessor
Get the status of this processor to display in the status bar of the GUI during file processing.

Warning: this method is called in a different Thread from the processing Thread (the Thread calling the process(..) method). It is usually called from the swing EventDispatchThread. So, be aware of possible threading synchronization problems while accessing the instance variables of your class.

Specified by:
getStatusMessage in interface FileProcessor
Returns:
the status of this processor.

getOutputCardinality

public int getOutputCardinality(int inputCardinality)
Description copied from interface: FileProcessor
Get the number of output streams generated for the given number of input streams.
possible values are:

Specified by:
getOutputCardinality in interface FileProcessor
Parameters:
inputCardinality - ONE or MANY.

getEditor

public net.sf.sfac.gui.editor.ObjectEditor getEditor()
Description copied from interface: FileProcessor
Get a GUI editor for this object.

Specified by:
getEditor in interface FileProcessor


Copyright © 2010. All Rights Reserved.