dk.netarkivet.common.utils.batch
Class FileRemover

java.lang.Object
  extended by dk.netarkivet.common.utils.batch.FileBatchJob
      extended by dk.netarkivet.common.utils.batch.FileRemover
All Implemented Interfaces:
java.io.Serializable

public class FileRemover
extends FileBatchJob

This class implements a batchjob that enables you to delete files from an archive. Note that the default Java Security Policy distributed with NetarchiveSuite does not allow this.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class dk.netarkivet.common.utils.batch.FileBatchJob
FileBatchJob.ExceptionOccurrence
 
Field Summary
 
Fields inherited from class dk.netarkivet.common.utils.batch.FileBatchJob
batchJobTimeout, exceptions, filesFailed, noOfFilesProcessed
 
Constructor Summary
FileRemover()
           
 
Method Summary
 void finish(java.io.OutputStream os)
          The method to finish the batchjob.
 void initialize(java.io.OutputStream os)
          The method to initialize the batchjob.
 boolean processFile(java.io.File file, java.io.OutputStream os)
          This method deletes the file in the argument list.
 
Methods inherited from class dk.netarkivet.common.utils.batch.FileBatchJob
addException, addFinishException, addInitializeException, getBatchJobTimeout, getExceptions, getFilenamePattern, getFilesFailed, getNoOfFilesProcessed, maxExceptionsReached, postProcess, processOnlyFileNamed, processOnlyFilesMatching, processOnlyFilesMatching, processOnlyFilesNamed, setBatchJobTimeout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileRemover

public FileRemover()
Method Detail

initialize

public void initialize(java.io.OutputStream os)
The method to initialize the batchjob.

Specified by:
initialize in class FileBatchJob
Parameters:
os - The OutputStream to which output should be written
See Also:
FileBatchJob.initialize(OutputStream)

processFile

public boolean processFile(java.io.File file,
                           java.io.OutputStream os)
This method deletes the file in the argument list. Note that the default Java Security Policy distributed with NetarchiveSuite does not allow this.

Specified by:
processFile in class FileBatchJob
Parameters:
file - The file to be processed
os - The OutputStream to which output should be written
Returns:
true, if and only if the file is succesfully deleted.
See Also:
FileBatchJob.processFile(File, OutputStream)

finish

public void finish(java.io.OutputStream os)
The method to finish the batchjob.

Specified by:
finish in class FileBatchJob
Parameters:
os - The OutputStream to which output should be written
See Also:
FileBatchJob.finish(OutputStream)