toolbox.file
Class FileRotateUtil

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

public class FileRotateUtil
extends java.lang.Object

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


Constructor Summary
FileRotateUtil(java.util.Map map)
          Default constructor.
 
Method Summary
 void rotate()
          Rotate 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

FileRotateUtil

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

Parameters:
map - Map instance that contains the properties required to ininitialise this utility.
  • file_rotate.base_dir: Absolute path the base directory.
  • file_rotate.prefix: Use this comman separated list of prefixes to match files.
  • file_rotate.suffix: Use this comma separated list of suffixes to match files.
  • file_rotate.size: Match files with this size or larger. Use "k", "m" or "g" as the unit.
  • file_rotate.output_dir_prefix: Use this as the prefix of the directory where rotated logs must be stored relative to base_dir.
  • file_rotate.date_format: Date format to you use when name files and directories.
Method Detail

rotate

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

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