org.pf.file
Class AFileProcessor

java.lang.Object
  extended by org.pf.file.AFileProcessor
All Implemented Interfaces:
IObjectProcessor

public abstract class AFileProcessor
extends java.lang.Object
implements IObjectProcessor

An abstract class that defines the method proccessFile( File ) to be implemented by any subclass. Such a subclass then can be used with FileWalker iterate recursivly over a file directory and process the found files.

Version:
1.0
Author:
M.Duchrow

Constructor Summary
AFileProcessor()
          Initialize the new instance with default values.
 
Method Summary
 boolean processFile(java.io.File file)
          Process the given file or directory in any appropriate way.
 boolean processObject(java.lang.Object object)
          Default implementation of interface IObjectProcessor that casts the given object to java.io.File if possible.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AFileProcessor

public AFileProcessor()
Initialize the new instance with default values.

Method Detail

processFile

public boolean processFile(java.io.File file)
Process the given file or directory in any appropriate way. Subclasses may override this method in order to do something useful. This implementation here is doing nothing at all and returns true.

Parameters:
file - The file or directory to process
Returns:
true if processing of files should continue, otherwise false

processObject

public boolean processObject(java.lang.Object object)
Default implementation of interface IObjectProcessor that casts the given object to java.io.File if possible. If the given object is no File then it will be ignored.

Specified by:
processObject in interface IObjectProcessor
Parameters:
object - The object to be processed (null must be handled)
Returns:
true to continue the processing, false to stop the processing