Package org.cip4.jdflib.util
Class RollingBackupFile
- java.lang.Object
-
- java.io.File
-
- org.cip4.jdflib.util.RollingBackupFile
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<java.io.File>
public class RollingBackupFile extends java.io.File- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RollingBackupFile(java.io.File file, int nBackupp)RollingBackupFile(java.lang.String pathname, int nBackupp)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearAll()remove all files, including main filejava.io.FilegetNewFile()java.io.FilegetNewFile(java.lang.String extension)get a new file for a given extensionjava.io.FilegetOldFile(int i)voidsetWantExtension(boolean wantExtension)-
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
-
RollingBackupFile
public RollingBackupFile(java.lang.String pathname, int nBackupp)- Parameters:
pathname- the base filenamenBackupp- the number of backups to retain
-
RollingBackupFile
public RollingBackupFile(java.io.File file, int nBackupp)- Parameters:
file- the base filenBackupp- the number of backups to retain
-
-
Method Detail
-
setWantExtension
public void setWantExtension(boolean wantExtension)
- Parameters:
wantExtension- the wantExtension to set
-
getNewFile
public java.io.File getNewFile()
- Returns:
- the file to write, i.e. this
-
getNewFile
public java.io.File getNewFile(java.lang.String extension)
get a new file for a given extension- Parameters:
extension-- Returns:
-
getOldFile
public java.io.File getOldFile(int i)
- Parameters:
i- the index of the file to read- Returns:
- the file to read, with backup
-
clearAll
public void clearAll()
remove all files, including main file
-
-