Package backupmanager.action
Class CopyFile
java.lang.Object
backupmanager.action.BackupAction
backupmanager.action.CopyFile
- All Implemented Interfaces:
 BackupFunction
- Direct Known Subclasses:
 CopyDatabaseFile,MoveFile
Copy a file from one location to another, trying to preserve any sub folder stucture 
 from the source to the destination directories.
- Author:
 - dg50
 
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionbooleancheckDestinationPath(String destination) createDestinationFile(BackupStream backupStream, String destination, StreamItem streamItem) Create the destination File object (not an actual file, the Java File object that identifies is).booleandoAction(BackupManager backupManager, BackupStream backupStream, StreamItem streamItem) Perform a backup action.protected booleanfileAction(File source, File dest) getDialogPanel(Window owner) Get a dialog panel for this action to incorporate into a larger dialog.getName()Get settings associated with this action.getSpace()booleanflag to say whether or not to run this action if any previous action threw an error.voidsetCopySettings(CopySettings copySettings) booleansetSettings(ActionSettings settings) Set settings.Methods inherited from class backupmanager.action.BackupAction
getActionMaker, getBackupFilter, getBackupStream, setBackupFilter, showDialog 
- 
Constructor Details
- 
CopyFile
 
 - 
 - 
Method Details
- 
doAction
public boolean doAction(BackupManager backupManager, BackupStream backupStream, StreamItem streamItem) throws BackupException Description copied from class:BackupActionPerform a backup action. Return false or throw an exception if the action fails.- Specified by:
 doActionin classBackupAction- Parameters:
 backupManager-streamItem-- Returns:
 - Throws:
 BackupException
 - 
createDestinationFile
public File createDestinationFile(BackupStream backupStream, String destination, StreamItem streamItem) throws BackupException Create the destination File object (not an actual file, the Java File object that identifies is).- Parameters:
 backupStream-destination-streamItem-- Returns:
 - Throws:
 BackupException
 - 
checkDestinationPath
- Throws:
 BackupException
 - 
fileAction
- Throws:
 BackupException
 - 
getName
- Specified by:
 getNamein interfaceBackupFunction- Specified by:
 getNamein classBackupAction- Returns:
 - a name for the action, to display in dialogs
 
 - 
getSettings
Description copied from class:BackupActionGet settings associated with this action.
All actions must return settings even if they have nothing in them, since the settings are needed to recreate the action based on it's class name.- Specified by:
 getSettingsin classBackupAction- Returns:
 - action settings
 
 - 
setSettings
Description copied from class:BackupActionSet settings. Will return false if they were the wrong type for this action - though that should not be possible.- Specified by:
 setSettingsin classBackupAction- Parameters:
 settings-- Returns:
 - true if settings are OK.
 
 - 
getDialogPanel
Description copied from class:BackupActionGet a dialog panel for this action to incorporate into a larger dialog.- Specified by:
 getDialogPanelin interfaceBackupFunction- Specified by:
 getDialogPanelin classBackupAction- Parameters:
 owner-- Returns:
 - dialog panel (assuming most actions have one - can return null).
 
 - 
getCopySettings
- Returns:
 - the copySettings
 
 - 
setCopySettings
- Parameters:
 copySettings- the copySettings to set
 - 
runIfPreviousActionError
public boolean runIfPreviousActionError()Description copied from class:BackupActionflag to say whether or not to run this action if any previous action threw an error. Actions such as a file copy would probably want to run anyway, since may be copying to different disks and if one is full, you'd want to copy to the other. But if you'd failed to copy a file to a backup drive, you probably wouldn't want to delete it!- Specified by:
 runIfPreviousActionErrorin classBackupAction- Returns:
 - true if it's OK to run this action when a previous action failed.
 
 - 
getSpace
- Overrides:
 getSpacein classBackupAction
 
 -