Top Description Fields Constructors Methods
org.apache.log.output.io.rotate

public Class UniqueFileStrategy

extends Object
implements FileStrategy
Class Inheritance
All Implemented Interfaces
org.apache.log.output.io.rotate.FileStrategy
Imports
java.io.File, java.text.SimpleDateFormat, java.util.Date

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
Authors
Bernhard Huber, Giacomo Pati

Field Summary

Modifier and TypeField and Description
private File
private SimpleDateFormat
private String

Constructor Summary

AccessConstructor and Description
public
UniqueFileStrategy(final File
the base file
baseFile
)

Creation of a new Unique File Strategy ??

public
UniqueFileStrategy(final File
the base file
baseFile
,
String
the format pattern
pattern
)

Creation of a new Unique File Strategy ??

public
UniqueFileStrategy(final File
the base file
baseFile
,
String
the format pattern
pattern
,
String
the suffix ??
suffix
)

Creation of a new Unique File Strategy ??

Method Summary

Modifier and TypeMethod and Description
public File

Returns:

File the calculated file name
nextFile
()

Implements org.apache.log.output.io.rotate.FileStrategy.nextFile.

Calculate the real file name from the base filename.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

m_baseFileback to summary
private File m_baseFile
m_formatterback to summary
private SimpleDateFormat m_formatter
m_suffixback to summary
private String m_suffix

Constructor Detail

UniqueFileStrategyback to summary
public UniqueFileStrategy(final File baseFile)

Creation of a new Unique File Strategy ??

Parameters
baseFile:File

the base file

UniqueFileStrategyback to summary
public UniqueFileStrategy(final File baseFile, String pattern)

Creation of a new Unique File Strategy ??

Parameters
baseFile:File

the base file

pattern:String

the format pattern

UniqueFileStrategyback to summary
public UniqueFileStrategy(final File baseFile, String pattern, String suffix)

Creation of a new Unique File Strategy ??

Parameters
baseFile:File

the base file

pattern:String

the format pattern

suffix:String

the suffix ??

Method Detail

nextFileback to summary
public File nextFile()

Implements org.apache.log.output.io.rotate.FileStrategy.nextFile.

Calculate the real file name from the base filename.

Returns:File

File the calculated file name