Package org.cip4.jdflib.util
Class BackupDirectory
java.lang.Object
java.io.File
org.cip4.jdflib.util.BackupDirectory
- All Implemented Interfaces:
Serializable,Comparable<File>,IPersistable
- Direct Known Subclasses:
RollingBackupDirectory
- See Also:
-
Field Summary
Fields inherited from class java.io.File
pathSeparator, pathSeparatorChar, separator, separatorChar -
Constructor Summary
ConstructorsConstructorDescriptionBackupDirectory(File file, int nBackupp) BackupDirectory(String pathname, int nBackupp) -
Method Summary
Modifier and TypeMethodDescriptionvoidclean()getNewFile(File localFile) creates a new file in this and assures than no more than nBackup files remaingetNewFile(String fileName) booleanbooleanpersist()physically persist the whatever stuffvoidsetDirectory(boolean isDirectory) toString()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, toURI, toURL
-
Constructor Details
-
BackupDirectory
- Parameters:
pathname- the DirectorynBackupp- the number of backups to retain- Throws:
IllegalArgumentException- if file exists and is not a directory
-
BackupDirectory
- Parameters:
file- the base filenBackupp- the number of backups to retain- Throws:
IllegalArgumentException- if file exists and is not a directory
-
-
Method Details
-
getNewFile
creates a new file in this and assures than no more than nBackup files remain- Parameters:
localFile- the local file to place in this directory- Returns:
- the file to write, null if an io exception occurred when creating it
-
clean
public void clean() -
getNewFile
- Parameters:
fileName-- Returns:
-
toString
-
persist
public boolean persist()Description copied from interface:IPersistablephysically persist the whatever stuff- Specified by:
persistin interfaceIPersistable- Returns:
- true if persist was successful
- See Also:
-
isCreateDirectory
public boolean isCreateDirectory() -
setDirectory
public void setDirectory(boolean isDirectory)
-