org.cip4.jdflib.util.file
Class RollingFile
java.lang.Object
java.io.File
org.cip4.jdflib.util.file.RollingFile
- All Implemented Interfaces:
- Serializable, Comparable<File>
- Direct Known Subclasses:
- RollingDateFile
public class RollingFile
- extends File
- Author:
- Dr. Rainer Prosi, Heidelberger Druckmaschinen AG
class to generate rolling backup files using a simple .n naming algorithm.
The oldest file dies when the maximum number is reached
08.12.2008
- See Also:
- Serialized Form
|
Field Summary |
protected org.apache.commons.logging.Log |
log
|
| Methods inherited from class java.io.File |
canExecute, canRead, canWrite, compareTo, createNewFile, createTempFile, createTempFile, delete, deleteOnExit, equals, exists, getAbsoluteFile, getAbsolutePath, getCanonicalFile, getCanonicalPath, getFreeSpace, getName, getParent, getParentFile, getPath, getTotalSpace, getUsableSpace, hashCode, isAbsolute, isDirectory, isFile, isHidden, lastModified, length, list, list, listFiles, listFiles, listFiles, listRoots, mkdir, mkdirs, renameTo, setExecutable, setExecutable, setLastModified, setReadable, setReadable, setReadOnly, setWritable, setWritable, toString, toURI, toURL |
log
protected final org.apache.commons.logging.Log log
RollingFile
public RollingFile(String pathname,
String baseName)
- Parameters:
pathname - the base filenamebaseName - the name of the base file,
if a filename with double "." , e.g. xxx..txt is specified, the algorithm will generate names such as xxx.000001.txt,
if a single "." e.g. xxx.txt is specified, the algorithm will generate names such as xxx000001.txt,
calcPos
protected void calcPos()
readAll
public File[] readAll()
- read all matching files from this
- Returns:
- array of all matching files
getFileExpression
protected String getFileExpression()
- Returns:
getNewFile
public File getNewFile()
- Returns:
- the file to write, null if error occurred
getNewFileName
protected String getNewFileName()
- Returns:
- the file to write, i.e. this
setDigits
public void setDigits(int digits)
- Parameters:
digits - the digits to set
Copyright © 2013. All Rights Reserved.