Class BackupDirectory

    • Field Summary

      • Fields inherited from class java.io.File

        pathSeparator, pathSeparatorChar, separator, separatorChar
    • Constructor Summary

      Constructors 
      Constructor Description
      BackupDirectory​(java.io.File file, int nBackupp)  
      BackupDirectory​(java.lang.String pathname, int nBackupp)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clean()  
      java.io.File getNewFile​(java.io.File localFile)
      creates a new file in this and assures than no more than nBackup files remain
      java.io.File getNewFile​(java.lang.String fileName)  
      boolean isCreateDirectory()  
      boolean persist()
      physically persist the whatever stuff
      void setDirectory​(boolean isDirectory)  
      java.lang.String 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
      • Methods inherited from class java.lang.Object

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

      • BackupDirectory

        public BackupDirectory​(java.lang.String pathname,
                               int nBackupp)
        Parameters:
        pathname - the Directory
        nBackupp - the number of backups to retain
        Throws:
        java.lang.IllegalArgumentException - if file exists and is not a directory
      • BackupDirectory

        public BackupDirectory​(java.io.File file,
                               int nBackupp)
                        throws java.lang.IllegalArgumentException
        Parameters:
        file - the base file
        nBackupp - the number of backups to retain
        Throws:
        java.lang.IllegalArgumentException - if file exists and is not a directory
    • Method Detail

      • getNewFile

        public java.io.File getNewFile​(java.io.File localFile)
        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

        public java.io.File getNewFile​(java.lang.String fileName)
        Parameters:
        fileName -
        Returns:
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.io.File
        See Also:
        File.toString()
      • isCreateDirectory

        public boolean isCreateDirectory()
      • setDirectory

        public void setDirectory​(boolean isDirectory)