org.cip4.jdflib.util
Class RollingBackupFile
java.lang.Object
java.io.File
org.cip4.jdflib.util.RollingBackupFile
- All Implemented Interfaces:
- Serializable, Comparable<File>
public class RollingBackupFile
- 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
| 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 |
RollingBackupFile
public RollingBackupFile(String pathname,
int nBackupp)
- Parameters:
pathname - the base filenamenBackupp - the number of backups to retain
RollingBackupFile
public RollingBackupFile(File file,
int nBackupp)
- Parameters:
file - the base filenBackupp - the number of backups to retain
getNewFile
public File getNewFile()
- Returns:
- the file to write, i.e. this
getNewFile
public File getNewFile(String extension)
- get a new file for a given extension
- Parameters:
extension -
- Returns:
getOldFile
public 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
Copyright © 2013. All Rights Reserved.