Class UpdateUrisCommand<T extends UriResource>

java.lang.Object
qupath.lib.gui.commands.UpdateUrisCommand<T>
Type Parameters:
T -

public class UpdateUrisCommand<T extends UriResource> extends Object
Fix broken URIs by using relative paths or prompting the user to select files. This is intended to handle cases where files or projects have changed location, so that links need to be updated.
Author:
Pete Bankhead
  • Method Details

    • promptToUpdateUris

      public static <T extends UriResource> int promptToUpdateUris(Collection<T> items, URI basePrevious, URI baseCurrent, boolean onlyPromptIfMissing) throws IOException
      Show dialog prompting the user to update URIs for missing files. Optionally provide previous and current base URIs. If not null, these will be used to relativize paths when searching for potential replacements URIs. Usually, these correspond to the current and previous paths for a project.
      Type Parameters:
      T -
      Parameters:
      items - the items containing URIs to check
      basePrevious - optional previous base path
      baseCurrent - optional current base path
      onlyPromptIfMissing - only show a dialog if any URIs correspond to missing files
      Returns:
      the number of changes made, or -1 if the user cancelled the dialog.
      Throws:
      IOException - if there was a problem accessing the URIs