Package dk.netarkivet.common.utils.batch
Class FileRemover
- java.lang.Object
-
- dk.netarkivet.common.utils.batch.FileBatchJob
-
- dk.netarkivet.common.utils.batch.FileRemover
-
- All Implemented Interfaces:
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.- Author:
- ngiraud, svc
- 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
Constructors Constructor Description FileRemover()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
finish(OutputStream os)
The method to finish the batchjob.void
initialize(OutputStream os)
The method to initialize the batchjob.boolean
processFile(File file, 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
-
-
-
-
Method Detail
-
initialize
public void initialize(OutputStream os)
The method to initialize the batchjob.- Specified by:
initialize
in classFileBatchJob
- Parameters:
os
- The OutputStream to which output should be written- See Also:
FileBatchJob.initialize(OutputStream)
-
processFile
public boolean processFile(File file, 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 classFileBatchJob
- Parameters:
file
- The file to be processedos
- 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(OutputStream os)
The method to finish the batchjob.- Specified by:
finish
in classFileBatchJob
- Parameters:
os
- The OutputStream to which output should be written- See Also:
FileBatchJob.finish(OutputStream)
-
-