Class RollingBackupFile

java.lang.Object
java.io.File
org.cip4.jdflib.util.RollingBackupFile
All Implemented Interfaces:
Serializable, Comparable<File>

public class RollingBackupFile extends File
See Also:
  • Constructor Details

    • RollingBackupFile

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

      public RollingBackupFile(File file, int nBackupp)
      Parameters:
      file - the base file
      nBackupp - the number of backups to retain
  • Method Details

    • setWantExtension

      public void setWantExtension(boolean wantExtension)
      Parameters:
      wantExtension - the wantExtension to set
    • 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