public interface BackupOperation
Backup operation allows to set backup parameters and run the backup.
Note that for security reasons, if the file name is entered by the user, you must check that it is located under the JIRA home directory, or force the file to be under that directory. This operation trusts the caller and doesn't do any checking.
If the specified backup file already exists, it will be overwritten.
Modifier and Type | Method and Description |
---|---|
BackupOperation |
backup()
Performs the backup synchronously.
|
File |
getFinalFile() |
BackupOperation |
setBackupHistory(boolean backupHistory)
Sets the
backupHistory flag. |
BackupOperation |
setFile(File file)
Sets the target file for the backup.
|
BackupOperation |
setUseZip(boolean useZip)
Sets the
useZip flag. |
@NotNull BackupOperation setFile(@NotNull File file)
Sets the target file for the backup. If the filename does not have extension,
".xml" or ".zip" will be appended automatically, depending on the useZip
flag.
The file must be an absolute path.
file
- backup fileIllegalArgumentException
- if the file is not a valid path@NotNull BackupOperation setUseZip(boolean useZip)
useZip
flag. When the flag is set, the target file will be a zipped
XML file, otherwise it will be a plain XML file.useZip
- true if the file content should be compressed@NotNull BackupOperation setBackupHistory(boolean backupHistory)
backupHistory
flag. When the flag is set, full structure history
will be backed up, otherwise the target file will only contain the current state
of the structures.backupHistory
- true if structure history should be backed up@NotNull BackupOperation backup() throws Exception
Exception
- if file cannot be written or any other problem happens@NotNull File getFinalFile()
setFile(java.io.File)
method, but probably
with added extension.IllegalStateException
- if the file has not been setCopyright © 2019 ALM Works. All Rights Reserved.