Class CopyFile

All Implemented Interfaces:
BackupFunction
Direct Known Subclasses:
CopyDatabaseFile, MoveFile

public class CopyFile extends BackupAction
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 Details Link icon

  • Method Details Link icon

    • doAction Link icon

      public boolean doAction(BackupManager backupManager, BackupStream backupStream, StreamItem streamItem) throws BackupException
      Description copied from class: BackupAction
      Perform a backup action. Return false or throw an exception if the action fails.
      Specified by:
      doAction in class BackupAction
      Returns:
      Throws:
      BackupException
    • createDestinationFile Link icon

      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 Link icon

      public boolean checkDestinationPath(String destination) throws BackupException
      Throws:
      BackupException
    • getName Link icon

      public String getName()
      Specified by:
      getName in interface BackupFunction
      Specified by:
      getName in class BackupAction
      Returns:
      a name for the action, to display in dialogs
    • getSettings Link icon

      public ActionSettings getSettings()
      Description copied from class: BackupAction
      Get 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:
      getSettings in class BackupAction
      Returns:
      action settings
    • setSettings Link icon

      public boolean setSettings(ActionSettings settings)
      Description copied from class: BackupAction
      Set settings. Will return false if they were the wrong type for this action - though that should not be possible.
      Specified by:
      setSettings in class BackupAction
      Returns:
      true if settings are OK.
    • getDialogPanel Link icon

      public PamDialogPanel getDialogPanel(Window owner)
      Description copied from class: BackupAction
      Get a dialog panel for this action to incorporate into a larger dialog.
      Specified by:
      getDialogPanel in interface BackupFunction
      Specified by:
      getDialogPanel in class BackupAction
      Parameters:
      owner - owner should be the dialog, not the main PAMGuard frame
      Returns:
      dialog panel (assuming most actions have one - can return null).
    • getCopySettings Link icon

      public CopySettings getCopySettings()
      Returns:
      the copySettings
    • setCopySettings Link icon

      public void setCopySettings(CopySettings copySettings)
      Parameters:
      copySettings - the copySettings to set
    • runIfPreviousActionError Link icon

      public boolean runIfPreviousActionError()
      Description copied from class: BackupAction
      flag 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:
      runIfPreviousActionError in class BackupAction
      Returns:
      true if it's OK to run this action when a previous action failed.
    • getSpace Link icon

      public String getSpace()
      Overrides:
      getSpace in class BackupAction