public class WGFileMetaData extends java.lang.Object implements WGExtensionDataContainer, WGFileAnnotations, MetaInfoProvider
_extData
are mutable and stored back.Modifier and Type | Class and Description |
---|---|
static class |
WGFileMetaData.ManualDerivate
A file derivate that was created manually
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EXTDATA_COPYRIGHT |
static java.lang.String |
EXTDATA_CUSTOM_FIELD_PREFIX |
static java.lang.String |
EXTDATA_DESCRIPTION |
static java.lang.String |
EXTDATA_DISPLAY_HEIGHT |
static java.lang.String |
EXTDATA_DISPLAY_WIDTH |
static java.lang.String |
EXTDATA_MANUAL_DERIVATE_DATA_PREFIX |
static java.lang.String |
EXTDATA_MANUAL_DERIVATE_DEFINITION_PREFIX |
static java.lang.String |
EXTDATA_MIMETYPE |
static java.lang.String |
EXTDATA_PLAINTEXT |
static java.lang.String |
EXTDATA_TITLE |
static java.lang.String |
EXTDATA_UPDATE_REVISION |
static java.lang.String |
META_COPYRIGHT |
static java.lang.String |
META_CREATED |
static java.lang.String |
META_DESCRIPTION |
static java.lang.String |
META_LASTMODIFIED |
static java.lang.String |
META_MD5CHECKSUM |
static java.lang.String |
META_MIMETYPE |
static java.lang.String |
META_NAME |
static java.lang.String |
META_SHA512CHECKSUM |
static java.lang.String |
META_SIZE |
static java.lang.String |
META_TITLE |
static MetaInfo |
METAINFO_COPYRIGHT |
static MetaInfo |
METAINFO_CREATED |
static MetaInfo |
METAINFO_DESCRIPTION |
static MetaInfo |
METAINFO_LASTMODIFIED |
static MetaInfo |
METAINFO_MD5CHECKSUM |
static MetaInfo |
METAINFO_MIMETYPE |
static MetaInfo |
METAINFO_NAME |
static MetaInfo |
METAINFO_SHA512CHECKSUM |
static MetaInfo |
METAINFO_SIZE |
static MetaInfo |
METAINFO_TITLE |
USAGE_ICON, USAGE_POSTER
Constructor and Description |
---|
WGFileMetaData(WGFileMetaDataContext context,
java.lang.String name,
long size,
java.util.Date created,
java.util.Date lastModified,
java.lang.String md5Checksum,
java.lang.String sha512Checksum,
java.util.Map<java.lang.String,java.lang.Object> extData) |
Modifier and Type | Method and Description |
---|---|
WGFileMetaData |
createClone()
Creates an identical clone of this metadata object
|
WGFileMetaDataContext |
getContext()
Returns the file metadata context
|
java.lang.String |
getCopyright()
Returns the copyright of this image
|
java.util.Date |
getCreated()
returns the date the file was attached on the document
|
java.util.List<java.lang.String> |
getCustomFieldNames()
Returns the names of custom fields annotated for this file
|
java.lang.Object |
getCustomFieldValue(java.lang.String fieldName)
Returns the value of a custom field annotated for this file
|
java.lang.String |
getDescription()
Returns the description of this image
|
int |
getDisplayHeight()
Returns the display height in pixels for images or videos
|
int |
getDisplayWidth()
Returns the display width in pixels for images or videos
|
java.lang.Object |
getExtensionData(java.lang.String strName)
Returns the value of an extension data field.
|
java.util.List<java.lang.String> |
getExtensionDataNames()
Returns the names of all extension data fields on this entity
|
java.util.Date |
getLastmodified()
returns the date the file was last modified for e.g. renamed
|
WGFileMetaData.ManualDerivate |
getManualDerivate(java.lang.String name)
Retrieves a manual derivate defined for this file
|
java.util.List<java.lang.String> |
getManualDerivateNames()
Returns the names of all manual derivates registered for this file
|
java.lang.String |
getMd5Checksum()
returns an md5 checksum of the file binary data
|
java.lang.Object |
getMetaData(java.lang.String name)
Returns a file metadata value by its field name
|
java.lang.String |
getMimeType()
Returns the mime type
|
java.lang.String |
getName()
returns the name of the file
|
WGDocument |
getParentDocument()
Returns the parent document to which the file, described by these file annotations, belong
|
BinaryFieldData |
getPlainText()
returns a plain text representation of the file
|
java.lang.String |
getSha512Checksum()
returns an SHA-512 checksum of the file binary data, available only since content store version 5 patch level 4
|
long |
getSize()
returns the file size in bytes
|
java.lang.String |
getTitle()
Returns the title of this file
|
WGDatabaseRevision |
getUpdateRevision()
Returns the revision when the contents of this file was updated the last time
|
java.lang.String |
getUsage()
Returns the usage of a file derivate, using constants #USAGE_...
|
void |
pushData(WGFileMetaData clone)
Pushes all data from this file metadata object to the parameter object
|
void |
removeCustomField(java.lang.String fieldName)
Removes a custom field annotated for this file
|
void |
removeExtensionData(java.lang.String strName)
Removes an extension data field from this entity
|
void |
removeManualDerivate(java.lang.String name)
Removes a manual derivate
|
void |
setContext(WGFileMetaDataContext parent)
Sets the file metadata context
|
void |
setCopyright(java.lang.String copyright)
Sets the copyright for this image
|
void |
setCustomFieldValue(java.lang.String fieldName,
java.lang.Object value)
Sets the value of a custom field annotated for this file
|
void |
setDescription(java.lang.String desc)
Sets the description of this image
|
void |
setDisplayHeight(int displayHeight)
Sets the display height in pixels for images or videos
|
void |
setDisplayWidth(int displayWidth)
Sets the display width in pixels for images or videos
|
void |
setManualDerivate(java.lang.String name,
java.lang.String usage,
java.io.InputStream data)
Defines a manual derivate for this file
|
void |
setMimeType(java.lang.String mimeType)
Sets the mime type
|
void |
setPlainText(BinaryFieldData plaintext)
sets the plain text representation of this file
|
void |
setTitle(java.lang.String title)
Sets the title of this file
|
void |
writeExtensionData(java.lang.String strName,
java.lang.Object value)
Sets the value of an extension data field.
|
public static final java.lang.String EXTDATA_MIMETYPE
public static final java.lang.String EXTDATA_DISPLAY_WIDTH
public static final java.lang.String EXTDATA_DISPLAY_HEIGHT
public static final java.lang.String EXTDATA_TITLE
public static final java.lang.String EXTDATA_DESCRIPTION
public static final java.lang.String EXTDATA_COPYRIGHT
public static final java.lang.String EXTDATA_CUSTOM_FIELD_PREFIX
public static final java.lang.String EXTDATA_MANUAL_DERIVATE_DEFINITION_PREFIX
public static final java.lang.String EXTDATA_MANUAL_DERIVATE_DATA_PREFIX
public static final java.lang.String EXTDATA_UPDATE_REVISION
public static final java.lang.String EXTDATA_PLAINTEXT
public static final java.lang.String META_NAME
public static final MetaInfo METAINFO_NAME
public static final java.lang.String META_TITLE
public static final MetaInfo METAINFO_TITLE
public static final java.lang.String META_DESCRIPTION
public static final MetaInfo METAINFO_DESCRIPTION
public static final java.lang.String META_COPYRIGHT
public static final MetaInfo METAINFO_COPYRIGHT
public static final java.lang.String META_CREATED
public static final MetaInfo METAINFO_CREATED
public static final java.lang.String META_LASTMODIFIED
public static final MetaInfo METAINFO_LASTMODIFIED
public static final java.lang.String META_SIZE
public static final MetaInfo METAINFO_SIZE
public static final java.lang.String META_MD5CHECKSUM
public static final MetaInfo METAINFO_MD5CHECKSUM
public static final java.lang.String META_SHA512CHECKSUM
public static final MetaInfo METAINFO_SHA512CHECKSUM
public static final java.lang.String META_MIMETYPE
public static final MetaInfo METAINFO_MIMETYPE
public WGFileMetaData(WGFileMetaDataContext context, java.lang.String name, long size, java.util.Date created, java.util.Date lastModified, java.lang.String md5Checksum, java.lang.String sha512Checksum, java.util.Map<java.lang.String,java.lang.Object> extData)
public java.lang.String getName()
public long getSize()
getSize
in interface WGFileAnnotations
public java.util.Date getCreated()
public java.util.Date getLastmodified()
public java.lang.String getMd5Checksum()
public java.lang.String getSha512Checksum()
public java.lang.Object getExtensionData(java.lang.String strName)
WGExtensionDataContainer
getExtensionData
in interface WGExtensionDataContainer
strName
- Name of the requested field.public java.util.List<java.lang.String> getExtensionDataNames() throws WGAPIException
WGExtensionDataContainer
getExtensionDataNames
in interface WGExtensionDataContainer
WGBackendException
WGAPIException
public void removeExtensionData(java.lang.String strName) throws WGAPIException
WGExtensionDataContainer
removeExtensionData
in interface WGExtensionDataContainer
strName
- Name of the field to remove.WGAPIException
public void writeExtensionData(java.lang.String strName, java.lang.Object value) throws WGAPIException
WGExtensionDataContainer
writeExtensionData
in interface WGExtensionDataContainer
strName
- Name of the requested field.value
- The value of the fieldWGAPIException
public java.util.List<java.lang.String> getCustomFieldNames()
WGFileAnnotations
getCustomFieldNames
in interface WGFileAnnotations
public java.lang.Object getCustomFieldValue(java.lang.String fieldName)
WGFileAnnotations
getCustomFieldValue
in interface WGFileAnnotations
fieldName
- Name of the fieldpublic void setCustomFieldValue(java.lang.String fieldName, java.lang.Object value) throws WGAPIException
WGFileAnnotations
setCustomFieldValue
in interface WGFileAnnotations
fieldName
- Name of the fieldvalue
- Value of the fieldWGAPIException
public void removeCustomField(java.lang.String fieldName) throws WGAPIException
WGFileAnnotations
removeCustomField
in interface WGFileAnnotations
fieldName
- Name of the fieldWGAPIException
public WGFileMetaDataContext getContext()
public void setContext(WGFileMetaDataContext parent)
parent
- The contextpublic WGFileMetaData createClone() throws WGAPIException
WGAPIException
public void pushData(WGFileMetaData clone) throws WGAPIException
clone
- The target objectWGAPIException
public java.lang.String getMimeType()
WGFileAnnotations
getMimeType
in interface WGFileAnnotations
public void setMimeType(java.lang.String mimeType) throws WGAPIException
WGFileAnnotations
setMimeType
in interface WGFileAnnotations
WGAPIException
public int getDisplayHeight()
WGFileAnnotations
getDisplayHeight
in interface WGFileAnnotations
public void setDisplayHeight(int displayHeight) throws WGAPIException
WGFileAnnotations
setDisplayHeight
in interface WGFileAnnotations
WGAPIException
public int getDisplayWidth()
WGFileAnnotations
getDisplayWidth
in interface WGFileAnnotations
public void setDisplayWidth(int displayWidth) throws WGAPIException
WGFileAnnotations
setDisplayWidth
in interface WGFileAnnotations
WGAPIException
public java.lang.String getTitle()
public void setTitle(java.lang.String title) throws WGAPIException
title
- The titleWGAPIException
public java.lang.String getDescription()
public void setDescription(java.lang.String desc) throws WGAPIException
desc
- The descriptionWGAPIException
public java.lang.String getCopyright()
public void setCopyright(java.lang.String copyright) throws WGAPIException
copyright
- The copyrightWGAPIException
public java.lang.String getUsage() throws WGAPIException
WGFileAnnotations
getUsage
in interface WGFileAnnotations
WGAPIException
public WGDatabaseRevision getUpdateRevision() throws WGAPIException
WGAPIException
public BinaryFieldData getPlainText() throws WGAPIException
WGFileAnnotations
getPlainText
in interface WGFileAnnotations
WGAPIException
public void setPlainText(BinaryFieldData plaintext) throws WGAPIException
WGFileAnnotations
setPlainText
in interface WGFileAnnotations
plaintext
- plain text dataWGAPIException
public java.lang.Object getMetaData(java.lang.String name)
name
- The field namepublic WGDocument getParentDocument() throws WGAPIException
WGFileAnnotations
getParentDocument
in interface WGFileAnnotations
WGAPIException
public java.util.List<java.lang.String> getManualDerivateNames() throws WGAPIException
WGAPIException
public WGFileMetaData.ManualDerivate getManualDerivate(java.lang.String name) throws WGAPIException
name
- Name of the derivateWGAPIException
public void setManualDerivate(java.lang.String name, java.lang.String usage, java.io.InputStream data) throws WGAPIException
name
- Name of the derivateusage
- Usage of the derivate. Use WGFileAnnotations.USAGE_* constants.data
- The data for the derivateWGAPIException
public void removeManualDerivate(java.lang.String name) throws WGAPIException
name
- Name of the derivateWGAPIException