toolbox.file
Class FileArchiveUtil

Package class diagram package FileArchiveUtil
java.lang.Object
  extended by toolbox.file.FileArchiveUtil

public class FileArchiveUtil
extends java.lang.Object

Convenience class to archive a specific file or set of files.


Constructor Summary
FileArchiveUtil(java.util.Map map)
          Default constructor.
 
Method Summary
 void archive()
          Archive files based on the instance configuration properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileArchiveUtil

public FileArchiveUtil(java.util.Map map)
Default constructor.

Parameters:
map - Map instance that contains the properties required to ininitialise this utility.
  • file_archive.base_dir: Absolute path the base directory.
  • file_archive.prefix: Use this comman separated list of prefixes to match files.
  • file_archive.suffix: Use this comma separated list of suffixes to match files.
  • file_archive.operation: "copy" or "remove"
  • file_archive.age: Match files with this age or older. Use "h" or "d" as the unit.
  • file_archive.output_dir_prefix: Use this as the prefix of the directory where rotated logs must be stored relative to base_dir.
  • file_archive.date_format: Date format to you use when name files and directories.
Method Detail

archive

public void archive()
             throws java.io.IOException
Archive files based on the instance configuration properties.

Throws:
java.io.IOException - if the files cannot be archived.