Interface Thumbnail
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ThumbnailDetail
public interface Thumbnail extends Serializable
A thumbnail is an image summarizing a type of resource or the content of a contribution. Usually such objects should implement theWithThumbnail
interface. The thumbnail is an image stored into a file on the filesystem and this image can be cropped either by the user or by Silverpeas itself to answer some requirements.- Author:
- mmoquillon
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canBeCropped()
Is this thumbnail can be cropped?String
getCropFileName()
Gets the name of the file in which is stored the cropped version of the image and that will be actually used as thumbnail.String
getImageFileName()
Gets the name of the file in which is stored the thumbnail by following the process: first it checks for a file with the cropped image of the thumbnail, if no such file is found, then it rollbacks to the original file of the thumbnail.String
getMimeType()
Gets the MIME type of the thumbnail.String
getNonCroppedURL()
Gets the URL of non cropped thumbnail in Silverpeas in order to be rendered in management features.String
getOriginalFileName()
Gets the name of the file in which is stored the image that was uploaded to be used as a thumbnail of a resource in Silverpeas.Optional<Path>
getPath()
Gets the absolute path of this thumbnail in the file system.ResourceReference
getReference()
Gets the resource or the contribution in Silverpeas to which this thumbnail is related.String
getURL()
Gets the URL of the thumbnail in Silverpeas in order to be rendered in the Web client.boolean
isCropped()
Is this thumbnail has been cropped?
-
-
-
Method Detail
-
getReference
ResourceReference getReference()
Gets the resource or the contribution in Silverpeas to which this thumbnail is related.- Returns:
- a reference to the resource or to the contribution related by this image.
-
getMimeType
String getMimeType()
Gets the MIME type of the thumbnail. For example "image/jpeg" for a JPEG image.- Returns:
- the MIME type of the image.
-
getImageFileName
String getImageFileName()
Gets the name of the file in which is stored the thumbnail by following the process: first it checks for a file with the cropped image of the thumbnail, if no such file is found, then it rollbacks to the original file of the thumbnail. If the crop file name exists it is returned, otherwise the original file name is returned.- Returns:
- a file name as string.
-
getOriginalFileName
String getOriginalFileName()
Gets the name of the file in which is stored the image that was uploaded to be used as a thumbnail of a resource in Silverpeas.- Returns:
- the original file name of this image.
-
getCropFileName
String getCropFileName()
Gets the name of the file in which is stored the cropped version of the image and that will be actually used as thumbnail. If no cropped version exists (checks with theisCropped()
method), null is returned.- Returns:
- the file name of the cropped version of this image. Null if no cropped version exists.
-
isCropped
boolean isCropped()
Is this thumbnail has been cropped?- Returns:
- true if it exists a cropped version of this thumbnail. False otherwise.
-
canBeCropped
boolean canBeCropped()
Is this thumbnail can be cropped?- Returns:
- true if the Silverpeas can crop this image. False otherwise.
-
getURL
String getURL()
Gets the URL of the thumbnail in Silverpeas in order to be rendered in the Web client.If
isCropped()
returns true, then the URL returned is the one of cropped thumbnail.- Returns:
- the URL of this thumbnail.
-
getNonCroppedURL
String getNonCroppedURL()
Gets the URL of non cropped thumbnail in Silverpeas in order to be rendered in management features.- Returns:
- the URL of the non cropped thumbnail.
-
getPath
Optional<Path> getPath()
Gets the absolute path of this thumbnail in the file system. If no path is defined for this image (for example the image comes from an hyperlink), then nothing is returned.- Returns:
- the path of the thumbnail in the file system or nothing if the image is provided by an hyperlink.
-
-