Interface Picture
- All Superinterfaces:
Comparable<StoreElement>
,MediaElement
,StoreElement
,Workflowable
This interface provides methods to handle a media object of type PICTURE from the MediaStore.
A Picture
can be retrieved from a type Media
object by calling the
Media.getPicture(Language)
getPicture()}-method.
A language must be provided within the method call.
- Since:
- 3.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionGet the description of the current media.@Nullable InputStream
getInputStream
(Resolution resolution) Get the picture content of the current picture-media as an input stream.Get the language of the current picture-media@Nullable MediaMetaData
getPictureMetaData
(Resolution resolution) Return media metadata for explicitly set and automatically generated picture resolutions.@NotNull PictureResolution
getPictureResolution
(Resolution resolution) Get the picture-resolution childStoreElement
of this picture-media for the given resolution.byte @Nullable []
Deprecated.byte @Nullable []
Get a small preview/thumbnail image of this picture.void
removePicture
(Resolution resolution) Remove the picture of the current picture-media for given resolution.void
setDescription
(String description) Set the description of the current media.void
setPicture
(Resolution resolution, long length, InputStream pictureStream, @Nullable String extension) Uploads the picture data for the given resolution by reading from the given input stream.void
setPreviewImage
(@org.jetbrains.annotations.Nullable byte[] bytes) Set the image data source to create a preview-thumbnail from.Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface de.espirit.firstspirit.access.store.StoreElement
appendChild, appendChildBefore, delete, exportStoreElement, getChildCount, getChildIndex, getChildren, getChildren, getChildren, getChildren, getCreateWorkflowPermission, getDefinedPrincipalPermissions, getEditor, getElementType, getFirstChild, getIncomingReferences, getInheritedPrincipalPermissions, getLastChanged, getName, getNextSibling, getOutgoingReferences, getParent, getPermission, getPermission, getPermission, getPreviousSibling, getProject, getReferenceName, getReferences, getReferences, getStore, getTreePermission, getWorkflowPermission, getWorkflowPermissions, getWriteLock, hasIncomingReferences, hasPermissions, importStoreElement, importStoreElements, inheritWorkflowPermission, isDeleted, isExportSupported, isFolder, isImportSupported, isLocked, isLockedOnServer, isLockSupported, isPermissionSupported, isWorkflowAllowed, isWorkflowSupported, refresh, removeAllWorkflowPermissions, removeChild, removePermission, removePermission, removePermission, removeWorkflowPermission, replaceChild, save, save, save, setInheritWorkflowPermission, setLock, setLock, setPermission, setPermission, setPermission, setWorkflowPermission, setWorkflowPermissions, setWriteLock, toXml, toXml, toXml
Methods inherited from interface de.espirit.firstspirit.access.Workflowable
getColor, getTask, hasTask, removeTask, setColor, setTask
-
Method Details
-
getLanguage
Language getLanguage()Get the language of the current picture-media- Returns:
- language of the current picture-media as object.
- Since:
- 3.0
-
getPictureMetaData
Return media metadata for explicitly set and automatically generated picture resolutions. Only returnsnull
if a picture is not explicitly set for the resolution and an automatically generated picture resolution could not be generated because an original resolution is not available. In all other cases the result value is notnull
.- Parameters:
resolution
- the resolution to get the media metadata for.- Returns:
- the media metadata for the resolution.
- Throws:
IOException
- Since:
- 4.0
-
getInputStream
Get the picture content of the current picture-media as an input stream. The returned image is either an on demand scaled version of the original image or a saved resolution.- Parameters:
resolution
- theresolution
to get the picture data for.- Returns:
- the picture data as stream.
- Throws:
IOException
- thrown if any error occurs loading the picture.- Since:
- 4.0
-
setPicture
void setPicture(Resolution resolution, long length, InputStream pictureStream, @Nullable @Nullable String extension) throws IOException Uploads the picture data for the given resolution by reading from the given input stream.- Parameters:
resolution
- the resolution to set the picture data forlength
- the length of the given input streampictureStream
- the data streamextension
- the extension for the picture (ifnull
the extension is determined from the calculated mime type)- Throws:
IOException
- thrown if any error occurs setting the picture.- Since:
- 4.0
-
removePicture
Remove the picture of the current picture-media for given resolution.- Parameters:
resolution
- resolution for which the picture has to be removed.- Throws:
IOException
- Since:
- 3.0
-
getPictureResolution
Get the picture-resolution childStoreElement
of this picture-media for the given resolution.- Parameters:
resolution
- resolution for which the picture-resolution must be returned.- Returns:
- picture-resolution of the current picture-media.
- Since:
- 3.0
-
getDescription
String getDescription()Get the description of the current media.- Returns:
- description of the media.
- Since:
- 3.0
-
setDescription
Set the description of the current media.- Parameters:
description
- new description of the media.- Since:
- 3.0
-
getPreview
Deprecated.since 5.0 - usegetPreviewImage()
Get a small preview/thumbnail image of this picture.- Returns:
- preview picture-media or
null
. - Throws:
IOException
- if any error occurs while obtaining the preview .- Since:
- 3.0
-
getPreviewImage
Get a small preview/thumbnail image of this picture.- Returns:
- preview the picture-media preview image or
null
. - Throws:
IOException
- thrown if any error occurs while obtaining the preview image stream.- Since:
- 5.0.100
-
setPreviewImage
void setPreviewImage(@Nullable @org.jetbrains.annotations.Nullable byte[] bytes) Set the image data source to create a preview-thumbnail from. This could be a non-scaled instance, down-scaling to fit into 100x100 pixels is then done automatically.- Parameters:
bytes
- the image data ornull
to reset the preview image.- Since:
- 5.0.100
-
getPreviewImage()