Package org.cip4.jdflib.util
Class RollingBackupFile
java.lang.Object
java.io.File
org.cip4.jdflib.util.RollingBackupFile
- All Implemented Interfaces:
Serializable,Comparable<File>
- See Also:
-
Field Summary
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar -
Constructor Summary
ConstructorsConstructorDescriptionRollingBackupFile(File file, int nBackupp) RollingBackupFile(String pathname, int nBackupp) -
Method Summary
Modifier and TypeMethodDescriptionvoidclearAll()remove all files, including main filegetNewFile(String extension) get a new file for a given extensiongetOldFile(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 Details
-
RollingBackupFile
- Parameters:
pathname- the base filenamenBackupp- the number of backups to retain
-
RollingBackupFile
- Parameters:
file- the base filenBackupp- the number of backups to retain
-
-
Method Details
-
setWantExtension
public void setWantExtension(boolean wantExtension) - Parameters:
wantExtension- the wantExtension to set
-
getNewFile
- Returns:
- the file to write, i.e. this
-
getNewFile
get a new file for a given extension- Parameters:
extension-- Returns:
-
getOldFile
- 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
-