Class OverwriteQuestion

java.lang.Object
org.xwiki.filemanager.job.OverwriteQuestion

@Unstable public class OverwriteQuestion extends Object
Question asked when a file with the same name is found during a copy or move operation and we don't know whether to overwrite or keep the existing file.
Since:
2.0M1
Version:
$Id$
  • Constructor Summary

    Constructors
    Constructor
    Description
    OverwriteQuestion(org.xwiki.model.reference.DocumentReference source, org.xwiki.model.reference.DocumentReference destination)
    Ask whether to overwrite or not the destination file with the source file.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.xwiki.model.reference.DocumentReference
     
    org.xwiki.model.reference.DocumentReference
     
    boolean
     
    boolean
     
    void
    setAskAgain(boolean askAgain)
    Sets whether this question will be asked again or not if another file with the same name is found.
    void
    setOverwrite(boolean overwrite)
    Sets whether to overwrite or not the file that exists in the destination folder with the one being copied or moved.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OverwriteQuestion

      public OverwriteQuestion(org.xwiki.model.reference.DocumentReference source, org.xwiki.model.reference.DocumentReference destination)
      Ask whether to overwrite or not the destination file with the source file.
      Parameters:
      source - the file being copied or moved
      destination - a file with the same name that exists in the destination folder
  • Method Details

    • getSource

      public org.xwiki.model.reference.DocumentReference getSource()
      Returns:
      the file that is being copied or moved
    • getDestination

      public org.xwiki.model.reference.DocumentReference getDestination()
      Returns:
      a file with the same name that exists in the destination folder
    • isOverwrite

      public boolean isOverwrite()
      Returns:
      true to overwrite the file that exists in the destination folder with the one being copied or moved, false to keep the exiting file
    • setOverwrite

      public void setOverwrite(boolean overwrite)
      Sets whether to overwrite or not the file that exists in the destination folder with the one being copied or moved.
      Parameters:
      overwrite - true to overwrite, false to keep
    • isAskAgain

      public boolean isAskAgain()
      Returns:
      whether this question will be asked again or not if another file with the same name is found.
    • setAskAgain

      public void setAskAgain(boolean askAgain)
      Sets whether this question will be asked again or not if another file with the same name is found.
      Parameters:
      askAgain - true to ask again, false to perform the same action for the following files, during the current operation