Package qupath.lib.io

Interface UriResource

All Known Subinterfaces:
ImageDataOp, ImageOp, ProjectImageEntry<T>
All Known Implementing Classes:
DnnObjectClassifier, ImageOps.PaddedOp, OpenCVDnn, OpenCVModelObjectClassifier

public interface UriResource
Interface for objects that depend upon URIs. Examples include images, where the URI refer to the image file or URL, or prediction models.
  • Method Details

    • getUris

      default Collection<URI> getUris() throws IOException
      Throws:
      IOException
    • updateUris

      default boolean updateUris(Map<URI,URI> replacements) throws IOException
      Throws:
      IOException
    • getURIs

      Collection<URI> getURIs() throws IOException
      Get all the URIs required for this resource. This is often an empty or singleton list.
      Returns:
      the required URIs
      Throws:
      IOException
      Since:
      v0.4.0
    • updateURIs

      boolean updateURIs(Map<URI,URI> replacements) throws IOException
      Update the specified URIs.

      Warning! This should be used sparingly, particularly for objects that are otherwise immutable. It is intended only for correcting paths that have become invalid (e.g. because of files being relocated or transferred between computers) before first use of the object. It should not be used to manipulate an object after construction. Indeed, some implementations may throw an UnsupportedOperationException if called too late.

      Parameters:
      replacements - replacement map, where the key gives the current URI and the value gives its replacement.
      Returns:
      true if URIs were changed, false otherwise
      Throws:
      IOException
      Since:
      v0.4.0