Class RollingBackupFile

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<java.io.File>

    public class RollingBackupFile
    extends java.io.File
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.io.File

        pathSeparator, pathSeparatorChar, separator, separatorChar
    • 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
      void clearAll()
      remove all files, including main file
      java.io.File getNewFile()  
      java.io.File getNewFile​(java.lang.String extension)
      get a new file for a given extension
      java.io.File getOldFile​(int i)  
      void setWantExtension​(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
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • RollingBackupFile

        public RollingBackupFile​(java.lang.String pathname,
                                 int nBackupp)
        Parameters:
        pathname - the base filename
        nBackupp - the number of backups to retain
      • RollingBackupFile

        public RollingBackupFile​(java.io.File file,
                                 int nBackupp)
        Parameters:
        file - the base file
        nBackupp - 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