Class ImageHandler

java.lang.Object
io.goobi.viewer.controller.imaging.ImageHandler

public class ImageHandler extends Object
Provides urls to download pdfs, images and image footer
Author:
Florian Alpers
  • Constructor Details

    • ImageHandler

      public ImageHandler()
    • ImageHandler

      public ImageHandler(AbstractApiUrlManager contentUrlManager)
      Parameters:
      contentUrlManager -
  • Method Details

    • getImageUrl

      public String getImageUrl(PhysicalElement page, PageType pageType)
      Returns the image link for the given page and pageType. For external images, this links to the IIIF image information json+ls For external images, this may either also be a IIIF image information or the image itself
      Parameters:
      page - a PhysicalElement object.
      pageType - a PageType object.
      Returns:
      a String object.
    • getImageUrl

      public String getImageUrl(PageType pageType, String pi, String filepath)
    • getImageUrl

      public String getImageUrl(PageType pageType, String pi, String filepath, String filename)
      Parameters:
      pageType -
      pi -
      filepath -
      filename -
      Returns:
      Generated URL
    • getImageUrl

      public String getImageUrl(PhysicalElement page)
      Returns the image link for the given page. For external images, this links to the IIIF image information json+ls For external images, this may either also be a IIIF image information or the image itself
      Parameters:
      page - a PhysicalElement object.
      Returns:
      a String object.
    • getImageInformation

      public de.intranda.api.iiif.image.ImageInformation getImageInformation(PhysicalElement page) throws de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException, URISyntaxException, PresentationException, IndexUnreachableException

      getImageInformation.

      Parameters:
      page - a PhysicalElement object.
      Returns:
      The image information for the image file of the given page
      Throws:
      de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException - if any.
      URISyntaxException - if any.
      PresentationException - if any.
      IndexUnreachableException - if any.
    • getImageInformation

      public de.intranda.api.iiif.image.ImageInformation getImageInformation(String url) throws URISyntaxException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException

      getImageInformation.

      Parameters:
      url - a String object.
      Returns:
      a ImageInformation object.
      Throws:
      URISyntaxException - if any.
      de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException - if any.
    • isExternalUrl

      protected static boolean isExternalUrl(String path)

      isExternalUrl.

      Parameters:
      path - a String object.
      Returns:
      true exactly if the given path starts with http:// or https://
    • isImageUrl

      protected static boolean isImageUrl(String url, boolean displayableTypesOnly)

      isImageUrl.

      Parameters:
      displayableTypesOnly - if true, the method only returns true for images that can be directly displayed in a browser (jpg and png)
      url - a String object.
      Returns:
      true if the url ends with an image file suffix
    • isRestrictedUrl

      public static boolean isRestrictedUrl(String path)

      isRestrictedUrl.

      Parameters:
      path - a String object.
      Returns:
      true if the path is an external url which has restricted access and must therefore be delivered via the contenetServer