Class 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 Detail

      • 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 Detail

      • 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