Package org.cip4.jdflib.util.file
Class RollingFile
- java.lang.Object
-
- java.io.File
-
- org.cip4.jdflib.util.file.RollingFile
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<java.io.File>
- Direct Known Subclasses:
RollingDateFile
public class RollingFile extends java.io.File- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.commons.logging.Loglog
-
Constructor Summary
Constructors Constructor Description RollingFile(java.lang.String pathname, java.lang.String baseName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcalcPos()protected java.lang.StringgetFileExpression()java.io.FilegetNewFile()protected java.lang.StringgetNewFileName()java.io.File[]readAll()read all matching files from thisvoidsetDigits(int digits)-
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, toPath, toString, toURI, toURL
-
-
-
-
Constructor Detail
-
RollingFile
public RollingFile(java.lang.String pathname, java.lang.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,
-
-
Method Detail
-
calcPos
protected int calcPos()
- Returns:
-
readAll
public java.io.File[] readAll()
read all matching files from this- Returns:
- array of all matching files
-
getFileExpression
protected java.lang.String getFileExpression()
- Returns:
-
getNewFile
public java.io.File getNewFile()
- Returns:
- the file to write, null if error occurred
-
getNewFileName
protected java.lang.String getNewFileName()
- Returns:
- the file to write, i.e. this
-
setDigits
public void setDigits(int digits)
- Parameters:
digits- the digits to set
-
-