Openfire 3.6.0 Javadoc

org.jivesoftware.util.log.output.io.rotate
Class UniqueFileStrategy

java.lang.Object
  extended by org.jivesoftware.util.log.output.io.rotate.UniqueFileStrategy
All Implemented Interfaces:
FileStrategy

public class UniqueFileStrategy
extends Object
implements FileStrategy

Strategy for naming log files based on appending time suffix. A file name can be based on simply appending the number of miliseconds since (not really sure) 1/1/1970. Other constructors accept a pattern of a SimpleDateFormat to form the appended string to the base file name as well as a suffix which should be appended last.

A new UniqueFileStrategy( new File("foo.", "yyyy-MM-dd", ".log" ) object will return File objects with file names like foo.2001-12-24.log

Author:
Bernhard Huber, Giacomo Pati

Constructor Summary
UniqueFileStrategy(File baseFile)
           
UniqueFileStrategy(File baseFile, String pattern)
           
UniqueFileStrategy(File baseFile, String pattern, String suffix)
           
 
Method Summary
 File currentFile()
          Get the current logfile
 File nextFile()
          Calculate the real file name from the base filename.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniqueFileStrategy

public UniqueFileStrategy(File baseFile)

UniqueFileStrategy

public UniqueFileStrategy(File baseFile,
                          String pattern)

UniqueFileStrategy

public UniqueFileStrategy(File baseFile,
                          String pattern,
                          String suffix)
Method Detail

currentFile

public File currentFile()
Description copied from interface: FileStrategy
Get the current logfile

Specified by:
currentFile in interface FileStrategy

nextFile

public File nextFile()
Calculate the real file name from the base filename.

Specified by:
nextFile in interface FileStrategy
Returns:
File the calculated file name

Openfire 3.6.0 Javadoc

Copyright © 2003-2008 Jive Software.