Class DefaultBackupFileStore

java.lang.Object
com.atlassian.crowd.manager.backup.DefaultBackupFileStore
All Implemented Interfaces:
BackupFileStore

public class DefaultBackupFileStore extends Object implements BackupFileStore
Default implementation of BackupFileStore.
Since:
v2.7
  • Constructor Details

  • Method Details

    • cleanUpAutomatedBackupFiles

      public void cleanUpAutomatedBackupFiles()
      Description copied from interface: BackupFileStore
      If there are more than the maximum number of automated backup files, delete the oldest ones
      Specified by:
      cleanUpAutomatedBackupFiles in interface BackupFileStore
    • getBackupDirectory

      public File getBackupDirectory()
      Description copied from interface: BackupFileStore
      Returns the directory where backup files are stored
      Specified by:
      getBackupDirectory in interface BackupFileStore
      Returns:
      the directory where backup files are stored
    • getBackupFiles

      public List<File> getBackupFiles()
      Description copied from interface: BackupFileStore
      Return a list of automated backup files, sorted by ascending date. Note: the date is taken from the filename, not from the file itself.
      Specified by:
      getBackupFiles in interface BackupFileStore
      Returns:
      a list of File
    • extractTimestamp

      public Date extractTimestamp(File file)
      Description copied from interface: BackupFileStore
      Extract the timestamp from the name of the given backup file.
      Specified by:
      extractTimestamp in interface BackupFileStore
      Parameters:
      file - an automated backup file
      Returns:
      a Date, or null if the file is not a valid backup file
    • toTimeStamp

      protected com.google.common.base.Function<File,Date> toTimeStamp()
    • isAutomatedBackup

      protected com.google.common.base.Predicate<File> isAutomatedBackup()
    • deleteFile

      protected void deleteFile(File file)
    • filesInBackupDirectory

      protected Iterable<File> filesInBackupDirectory()