Class ImageHandler
java.lang.Object
io.goobi.viewer.controller.imaging.ImageHandler
Provides urls to download pdfs, images and image footer
- Author:
- Florian Alpers
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionde.intranda.api.iiif.image.ImageInformation
getImageInformation.de.intranda.api.iiif.image.ImageInformation
getImageInformation.getImageUrl
(PageType pageType, String pi, String filepath) getImageUrl
(PageType pageType, String pi, String filepath, String filename) getImageUrl
(PhysicalElement page) Returns the image link for the given page.getImageUrl
(PhysicalElement page, PageType pageType) Returns the image link for the given page and pageType.protected static boolean
isExternalUrl
(String path) isExternalUrl.protected static boolean
isImageUrl
(String url, boolean displayableTypesOnly) isImageUrl.static boolean
isRestrictedUrl
(String path) isRestrictedUrl.
-
Constructor Details
-
ImageHandler
public ImageHandler() -
ImageHandler
- Parameters:
contentUrlManager
-
-
-
Method Details
-
getImageUrl
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
- aPhysicalElement
object.pageType
- aPageType
object.- Returns:
- a
String
object.
-
getImageUrl
-
getImageUrl
- Parameters:
pageType
-pi
-filepath
-filename
-- Returns:
- Generated URL
-
getImageUrl
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
- aPhysicalElement
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
- aPhysicalElement
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
- aString
object.- Returns:
- a
ImageInformation
object. - Throws:
URISyntaxException
- if any.de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
- if any.
-
isExternalUrl
isExternalUrl.
- Parameters:
path
- aString
object.- Returns:
- true exactly if the given path starts with
http://
orhttps://
-
isImageUrl
isImageUrl.
- Parameters:
displayableTypesOnly
- if true, the method only returns true for images that can be directly displayed in a browser (jpg and png)url
- aString
object.- Returns:
- true if the url ends with an image file suffix
-
isRestrictedUrl
isRestrictedUrl.
- Parameters:
path
- aString
object.- Returns:
- true if the path is an external url which has restricted access and must therefore be delivered via the contenetServer
-