Class HudsonBackup
- java.lang.Object
-
- org.jvnet.hudson.plugins.thinbackup.backup.HudsonBackup
-
public class HudsonBackup extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HudsonBackup.ZipperThread
Zipping the old backups is done in a thread so the rest of Hudson/Jenkins is not blocked.
-
Field Summary
Fields Modifier and Type Field Description static String
ARCHIVE_DIR_NAME
static String
BUILDS_DIR_NAME
static String
CHANGELOG_HISTORY_PLUGIN_DIR_NAME
static String
COMPLETED_BACKUP_FILE
static String
CONFIG_HISTORY_DIR_NAME
static String
CONFIG_XML
static String
CONFIGURATIONS_DIR_NAME
static String
DISABLED_EXTENSION
static String
HPI_FILE_EXTENSION
static String
INDEXING_DIR_NAME
static String
INSTALLED_PLUGINS_XML
static String
JOBS_DIR_NAME
static String
JPI_FILE_EXTENSION
static String
MULTIBRANCH_DIR_NAME
static String
NEXT_BUILD_NUMBER_FILE_NAME
static String
NODES_DIR_NAME
static String
PLUGINS_DIR_NAME
static String
PROMOTIONS_DIR_NAME
static String
SVN_CREDENTIALS_FILE_NAME
static String
SVN_EXTERNALS_FILE_NAME
static String
USERS_DIR_NAME
static String
USERSCONTENTS_DIR_NAME
static String
XML_FILE_EXTENSION
static String
ZIP_FILE_EXTENSION
-
Constructor Summary
Constructors Constructor Description HudsonBackup(ThinBackupPluginImpl plugin, ThinBackupPeriodicWork.BackupType backupType)
HudsonBackup(ThinBackupPluginImpl plugin, ThinBackupPeriodicWork.BackupType backupType, Date date, ItemGroup<TopLevelItem> hudson)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
backup()
void
removeEmptyDirs(File rootDir)
Deletes all empty directories, including rootDir if it is empty at the end.void
touchCompleteFile()
Creates a empty file backup-completed.info at the end of the backup.
-
-
-
Field Detail
-
BUILDS_DIR_NAME
public static final String BUILDS_DIR_NAME
- See Also:
- Constant Field Values
-
CONFIGURATIONS_DIR_NAME
public static final String CONFIGURATIONS_DIR_NAME
- See Also:
- Constant Field Values
-
PROMOTIONS_DIR_NAME
public static final String PROMOTIONS_DIR_NAME
- See Also:
- Constant Field Values
-
MULTIBRANCH_DIR_NAME
public static final String MULTIBRANCH_DIR_NAME
- See Also:
- Constant Field Values
-
INDEXING_DIR_NAME
public static final String INDEXING_DIR_NAME
- See Also:
- Constant Field Values
-
JOBS_DIR_NAME
public static final String JOBS_DIR_NAME
- See Also:
- Constant Field Values
-
USERS_DIR_NAME
public static final String USERS_DIR_NAME
- See Also:
- Constant Field Values
-
ARCHIVE_DIR_NAME
public static final String ARCHIVE_DIR_NAME
- See Also:
- Constant Field Values
-
CONFIG_HISTORY_DIR_NAME
public static final String CONFIG_HISTORY_DIR_NAME
- See Also:
- Constant Field Values
-
USERSCONTENTS_DIR_NAME
public static final String USERSCONTENTS_DIR_NAME
- See Also:
- Constant Field Values
-
NEXT_BUILD_NUMBER_FILE_NAME
public static final String NEXT_BUILD_NUMBER_FILE_NAME
- See Also:
- Constant Field Values
-
PLUGINS_DIR_NAME
public static final String PLUGINS_DIR_NAME
- See Also:
- Constant Field Values
-
NODES_DIR_NAME
public static final String NODES_DIR_NAME
- See Also:
- Constant Field Values
-
CONFIG_XML
public static final String CONFIG_XML
- See Also:
- Constant Field Values
-
XML_FILE_EXTENSION
public static final String XML_FILE_EXTENSION
- See Also:
- Constant Field Values
-
JPI_FILE_EXTENSION
public static final String JPI_FILE_EXTENSION
- See Also:
- Constant Field Values
-
HPI_FILE_EXTENSION
public static final String HPI_FILE_EXTENSION
- See Also:
- Constant Field Values
-
DISABLED_EXTENSION
public static final String DISABLED_EXTENSION
- See Also:
- Constant Field Values
-
ZIP_FILE_EXTENSION
public static final String ZIP_FILE_EXTENSION
- See Also:
- Constant Field Values
-
INSTALLED_PLUGINS_XML
public static final String INSTALLED_PLUGINS_XML
- See Also:
- Constant Field Values
-
CHANGELOG_HISTORY_PLUGIN_DIR_NAME
public static final String CHANGELOG_HISTORY_PLUGIN_DIR_NAME
- See Also:
- Constant Field Values
-
SVN_CREDENTIALS_FILE_NAME
public static final String SVN_CREDENTIALS_FILE_NAME
- See Also:
- Constant Field Values
-
SVN_EXTERNALS_FILE_NAME
public static final String SVN_EXTERNALS_FILE_NAME
- See Also:
- Constant Field Values
-
COMPLETED_BACKUP_FILE
public static final String COMPLETED_BACKUP_FILE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HudsonBackup
public HudsonBackup(ThinBackupPluginImpl plugin, ThinBackupPeriodicWork.BackupType backupType)
-
HudsonBackup
public HudsonBackup(ThinBackupPluginImpl plugin, ThinBackupPeriodicWork.BackupType backupType, Date date, ItemGroup<TopLevelItem> hudson)
-
-
Method Detail
-
backup
public void backup() throws IOException
- Throws:
IOException
-
touchCompleteFile
public void touchCompleteFile() throws IOException
Creates a empty file backup-completed.info at the end of the backup.- Throws:
IOException
- if an I/O Error occurs
-
removeEmptyDirs
public void removeEmptyDirs(File rootDir) throws IOException
Deletes all empty directories, including rootDir if it is empty at the end.- Parameters:
rootDir
- the directory to start from, not null- Throws:
IOException
- if an I/O Error occurs
-
-