Class FileCopier

java.lang.Object
qupath.lib.gui.FileCopier

public class FileCopier extends Object
Copy files to an output directory, prompting the user if necessary.

This is intended for interactive use; if there is an exception, the user will be notified by an error message dialog.

Since:
v0.5.0
Author:
Pete Bankhead
  • Constructor Details

    • FileCopier

      public FileCopier()
  • Method Details

    • title

      public FileCopier title(String title)
      Title for any dialog.
      Parameters:
      title -
      Returns:
    • relativeToUserDirectory

      public FileCopier relativeToUserDirectory()
      Specify that the copying is relative to the QuPath user directory. This is useful if copying files to the user directory itself, or a subdirectory. If this method is called, then the user will be prompted to create a user directory if one does not already exist.
      Returns:
    • outputPath

      public FileCopier outputPath(String name)
      Name of the output directory. If relativeToUserDirectory() is selected, this should be given relative to the QuPath user directory; otherwise, it should be an absolute path.
      Parameters:
      name -
      Returns:
      See Also:
    • outputPath

      public FileCopier outputPath(Path name)
      Path representing the output directory. If relativeToUserDirectory() is selected, this should be given relative to the QuPath user directory; otherwise, it should be an absolute path.
      Parameters:
      name -
      Returns:
      See Also:
    • inputFiles

      public FileCopier inputFiles(Collection<File> files)
      Collection of files to copy.
      Parameters:
      files -
      Returns:
      See Also:
    • inputPaths

      public FileCopier inputPaths(Collection<Path> paths)
      Collection of paths representing files to copy.
      Parameters:
      paths -
      Returns:
      See Also:
    • doCopy

      public void doCopy()
      Perform the copying. Note that any exceptions will be caught and displayed to the user in an error dialog.