public interface IBackupStore
| Modifier and Type | Method and Description |
|---|---|
boolean |
backup(java.io.File file)
Backup the file.
|
void |
backupAll(java.io.File file)
Backs up a file, or everything under a directory.
|
boolean |
backupCopy(java.io.File file)
Same as
backup(File) except that a copy is kept in the original location. |
void |
backupCopyAll(java.io.File file)
Backs up a file, or everything under a directory.
|
boolean |
backupDirectory(java.io.File file)
Performs backup of an empty directory.
|
void |
discard()
Discards and closes this BackupStore.
|
java.lang.String |
getBackupName()
Returns the unique backup name (this is the name of generated backup directories).
|
void |
restore()
Restores all backup files from backup store.
|
boolean backup(java.io.File file)
throws java.io.IOException
backupDirectory(File).
A file (path) can only be backed up once per IBackupStore instance.
If a directory is first backed up, and later replaced by a regular file, and this file
is also backed up (or vice versa) - an IllegalArgumentException is thrown
A backup can not be performed on a closed IBackupStore.file - - the file (or directory) to backupjava.io.IOException - - if the backup operation fails, or the file does not existjava.lang.IllegalStateException - - if the IBackupStore has been closedjava.lang.IllegalArgumentException - - on type mismatch (file vs. directory) of earlier backup, or if file does not existboolean backupCopy(java.io.File file)
throws java.io.IOException
backup(File) except that a copy is kept in the original location.
Can not be used to copy directories.file - to backup and copyjava.io.IOException - - if the backup operation fails, if the file does not exist, or if the copy can not be created.java.lang.IllegalStateException - - if the IBackupStore has been closedjava.lang.IllegalArgumentException - - on type mismatch (file vs. directory) of earlier backup, or if file is a directory.boolean backupDirectory(java.io.File file)
throws java.io.IOException
file - - the (empty) directory to back upjava.lang.IllegalArgumentException - if file is not a directory, or is not empty.java.io.IOException - if directory can not be moved to the backup store, or if the directory is not writeablevoid discard()
void restore()
throws java.io.IOException
java.io.IOException - if the backup was not fully restored - unrestored items should have been logged.java.lang.IllegalStateException - if the backup is already closed.java.lang.String getBackupName()
void backupAll(java.io.File file)
throws java.io.IOException
file - - file to backup or directoryjava.io.IOException - if backup operation failedvoid backupCopyAll(java.io.File file)
throws java.io.IOException
file - java.io.IOException