org.jenkinsci.plugins.periodicbackup
Class LocalDirectory

java.lang.Object
  extended by hudson.model.AbstractModelObject
      extended by org.jenkinsci.plugins.periodicbackup.Location
          extended by org.jenkinsci.plugins.periodicbackup.LocalDirectory
All Implemented Interfaces:
hudson.model.Describable<Location>, hudson.model.ModelObject, hudson.search.SearchableModelObject, hudson.search.SearchItem

public class LocalDirectory
extends Location

LocalDirectory defines the local folder to store the backup files


Nested Class Summary
static class LocalDirectory.DescriptorImpl
           
 
Field Summary
 
Fields inherited from class org.jenkinsci.plugins.periodicbackup.Location
enabled
 
Constructor Summary
LocalDirectory(java.io.File path, boolean enabled)
           
 
Method Summary
 void deleteBackupFiles(BackupObject backupObject)
          This method deletes all files related to given BackupObject
 boolean equals(java.lang.Object o)
           
 java.lang.Iterable<BackupObject> getAvailableBackups()
          This method returns Iterable of BackupObject(s) in this location
 java.lang.String getDisplayName()
           
 java.io.File getPath()
           
 int hashCode()
           
 java.lang.Iterable<java.io.File> retrieveBackupFromLocation(BackupObject backup, java.io.File tempDir)
          Retrieves backup archive files from this location
 void setPath(java.io.File path)
           
 void storeBackupInLocation(java.lang.Iterable<java.io.File> archives, java.io.File backupObjectFile)
          This method puts archived backup file(s) in location
 
Methods inherited from class org.jenkinsci.plugins.periodicbackup.Location
all, getDescriptor, getSearchUrl
 
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalDirectory

@DataBoundConstructor
public LocalDirectory(java.io.File path,
                                           boolean enabled)
Method Detail

getAvailableBackups

public java.lang.Iterable<BackupObject> getAvailableBackups()
Description copied from class: Location
This method returns Iterable of BackupObject(s) in this location

Specified by:
getAvailableBackups in class Location
Returns:
BackupObject(s) in location

storeBackupInLocation

public void storeBackupInLocation(java.lang.Iterable<java.io.File> archives,
                                  java.io.File backupObjectFile)
                           throws java.io.IOException
Description copied from class: Location
This method puts archived backup file(s) in location

Specified by:
storeBackupInLocation in class Location
Parameters:
archives - archive file(s)
backupObjectFile - File with serialized backupObject
Throws:
java.io.IOException - IO error

retrieveBackupFromLocation

public java.lang.Iterable<java.io.File> retrieveBackupFromLocation(BackupObject backup,
                                                                   java.io.File tempDir)
                                                            throws java.io.IOException,
                                                                   org.jenkinsci.plugins.periodicbackup.PeriodicBackupException
Description copied from class: Location
Retrieves backup archive files from this location

Specified by:
retrieveBackupFromLocation in class 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:
java.io.IOException - if anything goes wrong with IO
PeriodicBackupException - if anything else goes wrong

deleteBackupFiles

public void deleteBackupFiles(BackupObject backupObject)
Description copied from class: Location
This method deletes all files related to given BackupObject

Specified by:
deleteBackupFiles in class Location
Parameters:
backupObject - the backupObject of the backup we want to delete

getDisplayName

public java.lang.String getDisplayName()

getPath

public java.io.File getPath()

setPath

public void setPath(java.io.File path)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2004-2013. All Rights Reserved.