Class Storage
- java.lang.Object
-
- hudson.model.AbstractModelObject
-
- org.jenkinsci.plugins.periodicbackup.Storage
-
- All Implemented Interfaces:
hudson.model.Describable<Storage>
,hudson.model.ModelObject
,hudson.search.SearchableModelObject
,hudson.search.SearchItem
- Direct Known Subclasses:
NullStorage
,TarGzStorage
,ZipStorage
public abstract class Storage extends hudson.model.AbstractModelObject implements hudson.model.Describable<Storage>
Storage is responsible for operating on backup archives
-
-
Constructor Summary
Constructors Constructor Description Storage()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static hudson.DescriptorExtensionList<Storage,StorageDescriptor>
all()
This will allow to retrieve the list of plugins at runtimeabstract void
backupAddFile(File fileToStore)
Adds a file to an archive.abstract void
backupStart(String tempDirectoryPath, String archiveFilenameBase)
Initializes Storage for the archiving processabstract Iterable<File>
backupStop()
Finalizes the archiving processStorageDescriptor
getDescriptor()
String
getSearchUrl()
abstract void
unarchiveFiles(Iterable<File> archives, File finalResultDir)
Extracts backup files from given archives into the temporary directory after successful extraction the archives will be deleted-
Methods inherited from class hudson.model.AbstractModelObject
getSearch, getSearchIndex, getSearchName, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendError
-
-
-
-
Method Detail
-
backupStart
public abstract void backupStart(String tempDirectoryPath, String archiveFilenameBase) throws org.jenkinsci.plugins.periodicbackup.PeriodicBackupException
Initializes Storage for the archiving process- Parameters:
tempDirectoryPath
- String with a path to the temporary directory, where the archive(s) will be createdarchiveFilenameBase
- first part of the archive filename- Throws:
org.jenkinsci.plugins.periodicbackup.PeriodicBackupException
- if something goes wrong
-
backupAddFile
public abstract void backupAddFile(File fileToStore) throws org.jenkinsci.plugins.periodicbackup.PeriodicBackupException
Adds a file to an archive.- Parameters:
fileToStore
- The file that will be added to the archive- Throws:
org.jenkinsci.plugins.periodicbackup.PeriodicBackupException
- if something goes wrong
-
backupStop
public abstract Iterable<File> backupStop() throws org.jenkinsci.plugins.periodicbackup.PeriodicBackupException
Finalizes the archiving process- Returns:
- Archive files
- Throws:
org.jenkinsci.plugins.periodicbackup.PeriodicBackupException
- if something goes wrong
-
unarchiveFiles
public abstract void unarchiveFiles(Iterable<File> archives, File finalResultDir)
Extracts backup files from given archives into the temporary directory after successful extraction the archives will be deleted- Parameters:
archives
- backup archivesfinalResultDir
- Directory where the files will be extracted to, it should be empty at this point
-
getDescriptor
public StorageDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfacehudson.model.Describable<Storage>
-
getSearchUrl
public String getSearchUrl()
- Specified by:
getSearchUrl
in interfacehudson.search.SearchItem
-
all
public static hudson.DescriptorExtensionList<Storage,StorageDescriptor> all()
This will allow to retrieve the list of plugins at runtime- Returns:
- Collection of FileManager Descriptors
-
-