Class Location

  • All Implemented Interfaces:
    hudson.model.Describable<Location>, hudson.model.ModelObject, hudson.search.SearchableModelObject, hudson.search.SearchItem
    Direct Known Subclasses:
    LocalDirectory, S3

    public abstract class Location
    extends hudson.model.AbstractModelObject
    implements hudson.model.Describable<Location>
    Location determines where to store backup files and is responsible for accessing the backup files once stored
    • Field Detail

      • enabled

        public final boolean enabled
    • Constructor Detail

      • Location

        public Location​(boolean enabled)
    • Method Detail

      • getAvailableBackups

        public abstract Iterable<BackupObject> getAvailableBackups()
        This method returns Iterable of BackupObject(s) in this location
        Returns:
        BackupObject(s) in location
      • storeBackupInLocation

        public abstract void storeBackupInLocation​(Iterable<File> archives,
                                                   File backupObjectFile)
                                            throws IOException
        This method puts archived backup file(s) in location
        Parameters:
        archives - archive file(s)
        backupObjectFile - File with serialized backupObject
        Throws:
        IOException - IO error
      • retrieveBackupFromLocation

        public abstract Iterable<File> retrieveBackupFromLocation​(BackupObject backup,
                                                                  File tempDir)
                                                           throws IOException,
                                                                  org.jenkinsci.plugins.periodicbackup.PeriodicBackupException
        Retrieves backup archive files from this location
        Parameters:
        backup - BackupObject related to the backup
        tempDir - temporary directory to store archived backup file(s)
        Returns:
        Iterable of backup archive(s) in temporary location
        Throws:
        IOException - if anything goes wrong with IO
        org.jenkinsci.plugins.periodicbackup.PeriodicBackupException - if anything else goes wrong
      • deleteBackupFiles

        public abstract void deleteBackupFiles​(BackupObject backupObject)
        This method deletes all files related to given BackupObject
        Parameters:
        backupObject - the backupObject of the backup we want to delete
      • all

        public static hudson.DescriptorExtensionList<Location,​LocationDescriptor> all()
        This will allow to retrieve the list of plugins at runtime
        Returns:
        Collection of FileManager Descriptors
      • getDescriptor

        public LocationDescriptor getDescriptor()
        Specified by:
        getDescriptor in interface hudson.model.Describable<Location>
      • getSearchUrl

        public String getSearchUrl()
        Specified by:
        getSearchUrl in interface hudson.search.SearchItem