org.jenkinsci.plugins.periodicbackup
Class ZipStorage

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

public class ZipStorage
extends Storage


Nested Class Summary
static class ZipStorage.DescriptorImpl
           
 
Constructor Summary
ZipStorage(boolean multiVolume, long volumeSize)
           
 
Method Summary
 void backupAddFile(java.io.File fileToStore)
          Adds a file to an archive.
 void backupStart(java.lang.String tempDirectoryPath, java.lang.String archiveFilenameBase)
          Initializes Storage for the archiving process
 java.lang.Iterable<java.io.File> backupStop()
          Finalizes the archiving process
 boolean equals(java.lang.Object o)
           
 org.codehaus.plexus.archiver.zip.ZipArchiver getArchiver()
           
 int getArchivesNumber()
           
 int getCurrentArchiveFilesCount()
           
 long getCurrentArchiveTotalFilesSize()
           
 java.lang.String getDisplayName()
           
 long getVolumeSize()
           
 int hashCode()
           
 boolean isMultiVolume()
           
 void setMultiVolume(boolean multiVolume)
           
 void setVolumeSize(long volumeSize)
           
 void unarchiveFiles(java.lang.Iterable<java.io.File> archives, java.io.File tempDir)
          Extracts backup files from given archives into the temporary directory after successful extraction the archives will be deleted
 
Methods inherited from class org.jenkinsci.plugins.periodicbackup.Storage
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

ZipStorage

@DataBoundConstructor
public ZipStorage(boolean multiVolume,
                                       long volumeSize)
Method Detail

getCurrentArchiveTotalFilesSize

public long getCurrentArchiveTotalFilesSize()

getArchiver

public org.codehaus.plexus.archiver.zip.ZipArchiver getArchiver()

getCurrentArchiveFilesCount

public int getCurrentArchiveFilesCount()

getArchivesNumber

public int getArchivesNumber()

getVolumeSize

public long getVolumeSize()

setVolumeSize

public void setVolumeSize(long volumeSize)

isMultiVolume

public boolean isMultiVolume()

setMultiVolume

public void setMultiVolume(boolean multiVolume)

backupStart

public void backupStart(java.lang.String tempDirectoryPath,
                        java.lang.String archiveFilenameBase)
Description copied from class: Storage
Initializes Storage for the archiving process

Specified by:
backupStart in class Storage
Parameters:
tempDirectoryPath - String with a path to the temporary directory, where the archive(s) will be created
archiveFilenameBase - first part of the archive filename

backupAddFile

public void backupAddFile(java.io.File fileToStore)
                   throws org.jenkinsci.plugins.periodicbackup.PeriodicBackupException
Description copied from class: Storage
Adds a file to an archive.

Specified by:
backupAddFile in class Storage
Parameters:
fileToStore - The file that will be added to the archive
Throws:
PeriodicBackupException - if something goes wrong

backupStop

public java.lang.Iterable<java.io.File> backupStop()
                                            throws org.jenkinsci.plugins.periodicbackup.PeriodicBackupException
Description copied from class: Storage
Finalizes the archiving process

Specified by:
backupStop in class Storage
Returns:
Archive files
Throws:
PeriodicBackupException - if something goes wrong

unarchiveFiles

public void unarchiveFiles(java.lang.Iterable<java.io.File> archives,
                           java.io.File tempDir)
Description copied from class: Storage
Extracts backup files from given archives into the temporary directory after successful extraction the archives will be deleted

Specified by:
unarchiveFiles in class Storage
Parameters:
archives - backup archives
tempDir - Directory where the files will be extracted to, it should be empty at this point

getDisplayName

public java.lang.String getDisplayName()

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.