info.magnolia.dam.asset
Class AssetWrapper

java.lang.Object
  extended by info.magnolia.dam.asset.AssetWrapper
All Implemented Interfaces:
Asset

public class AssetWrapper
extends Object
implements Asset

Wrapper used for decoration, delegates method calls to a target asset.


Constructor Summary
AssetWrapper(Asset target)
           
 
Method Summary
 String getAssetProviderIdentifier()
           
 String getCaption()
           
 String getComment()
           
 InputStream getContentStream()
           
 String getCopyright()
           
 Object getCustomProperty(String propertyName)
          Give the ability to access a custom property from the Asset API.
 String getDescription()
           
 String getFileExtension()
           
 String getFileName()
           
 long getFileSize()
           
 String getIdentifier()
          This identifier is the key used by the DamIdParser in order to be able to identify both:
the Asset
the Asset Provider.
 String getLanguage()
           
 Calendar getLastModified()
           
 String getLink()
           
 String getMediaType()
           
 AssetMetadata getMetadata(String metaDataType)
           
 String getMimeType()
           
 String getName()
           
 String getPath()
           
 String getSubject()
           
 Asset getTarget()
           
 String getTitle()
           
static Asset unwrapAsset(Asset asset)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AssetWrapper

public AssetWrapper(Asset target)
Method Detail

getTarget

public Asset getTarget()

getName

public String getName()
Specified by:
getName in interface Asset
Returns:
Name of the Asset.

getLanguage

public String getLanguage()
Specified by:
getLanguage in interface Asset
Returns:
String representation of Locale http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt.

getIdentifier

public String getIdentifier()
Description copied from interface: Asset
This identifier is the key used by the DamIdParser in order to be able to identify both:
the Asset
the Asset Provider.

Specified by:
getIdentifier in interface Asset
Returns:
Unique Identifier of the Asset.

getTitle

public String getTitle()
Specified by:
getTitle in interface Asset
Returns:
Title of the Asset.

getMediaType

public String getMediaType()
Specified by:
getMediaType in interface Asset
Returns:
The MediaType definition part of the MediaType.

getSubject

public String getSubject()
Specified by:
getSubject in interface Asset
Returns:
The Subject of the Asset.

getDescription

public String getDescription()
Specified by:
getDescription in interface Asset
Returns:
The Description of Asset.

getCaption

public String getCaption()
Specified by:
getCaption in interface Asset
Returns:
The Asset Caption.

getCopyright

public String getCopyright()
Specified by:
getCopyright in interface Asset
Returns:
The Asset Copyright.

getMimeType

public String getMimeType()
Specified by:
getMimeType in interface Asset
Returns:
The Asset binary content mimeType.

getFileSize

public long getFileSize()
Specified by:
getFileSize in interface Asset
Returns:
The Asset binary content size.

getContentStream

public InputStream getContentStream()
Specified by:
getContentStream in interface Asset
Returns:
The Asset binary data as InputStream.

getMetadata

public AssetMetadata getMetadata(String metaDataType)
                          throws AssetMetadataTypeNotSupportedException
Specified by:
getMetadata in interface Asset
Returns:
The specific implementation of the requested Metadata. Null if the specified implementation was not found.
Throws:
AssetMetadataTypeNotSupportedException

getLink

public String getLink()
               throws DamException
Specified by:
getLink in interface Asset
Returns:
Return the Link to the default rendition.
Throws:
DamException

getPath

public String getPath()
Specified by:
getPath in interface Asset
Returns:
The Asset path. For JCR this is equivalent to Node.getPath()

getLastModified

public Calendar getLastModified()
Specified by:
getLastModified in interface Asset
Returns:
The Asset last modified Date.

getFileExtension

public String getFileExtension()
Specified by:
getFileExtension in interface Asset
Returns:
The Asset Binary content extension.

getFileName

public String getFileName()
Specified by:
getFileName in interface Asset
Returns:
The Asset Binary content file Name.

getComment

public String getComment()
Specified by:
getComment in interface Asset
Returns:
The Asset comment.

getAssetProviderIdentifier

public String getAssetProviderIdentifier()
Specified by:
getAssetProviderIdentifier in interface Asset
Returns:
The related Asset Provider Id.

getCustomProperty

public Object getCustomProperty(String propertyName)
Description copied from interface: Asset
Give the ability to access a custom property from the Asset API.

Specified by:
getCustomProperty in interface Asset
Returns:
The Asset property referred to by the propertyName. Null if not found.

unwrapAsset

public static Asset unwrapAsset(Asset asset)


Copyright © 2014 Magnolia International Ltd.. All Rights Reserved.