FileStrategy
public class UniqueFileStrategy extends java.lang.Object implements FileStrategy
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
Modifier and Type | Field | Description |
---|---|---|
private java.io.File |
m_baseFile |
|
private java.text.SimpleDateFormat |
m_formatter |
|
private java.lang.String |
m_suffix |
Constructor | Description |
---|---|
UniqueFileStrategy(java.io.File baseFile) |
Creation of a new Unique File Strategy ??
|
UniqueFileStrategy(java.io.File baseFile,
java.lang.String pattern) |
Creation of a new Unique File Strategy ??
|
UniqueFileStrategy(java.io.File baseFile,
java.lang.String pattern,
java.lang.String suffix) |
Creation of a new Unique File Strategy ??
|
Modifier and Type | Method | Description |
---|---|---|
java.io.File |
nextFile() |
Calculate the real file name from the base filename.
|
private java.io.File m_baseFile
private java.text.SimpleDateFormat m_formatter
private java.lang.String m_suffix
public UniqueFileStrategy(java.io.File baseFile)
baseFile
- the base filepublic UniqueFileStrategy(java.io.File baseFile, java.lang.String pattern)
baseFile
- the base filepattern
- the format patternpublic UniqueFileStrategy(java.io.File baseFile, java.lang.String pattern, java.lang.String suffix)
baseFile
- the base filepattern
- the format patternsuffix
- the suffix ??public java.io.File nextFile()
nextFile
in interface FileStrategy
Copyright © 2003-2004 The Apache Software Foundation. All Rights Reserved.