info.magnolia.dam.api
Interface Asset

All Superinterfaces:
Item
All Known Implementing Classes:
AssetDecorator

public interface Asset
extends Item

An asset is a digital resource with associated metadata.


Method Summary
 String getCaption()
           
 String getComment()
           
 InputStream getContentStream()
          Opens an InputStream to the binary data of this Asset.
 String getCopyright()
           
 Calendar getCreated()
           
 String getDescription()
           
 String getFileName()
          Returns the "preferred" file name for this asset's binary.
 long getFileSize()
           
 String getLanguage()
           
 Calendar getLastModified()
           
 String getLink()
          Returns a link to the binary of this asset; that is, a (partial) URL usable by client code to download the asset.
<M extends AssetMetadata>
M
getMetadata(Class<M> metaDataType)
           
 String getMimeType()
           
 String getSubject()
           
 String getTitle()
           
 
Methods inherited from interface info.magnolia.dam.api.Item
getAssetProvider, getItemKey, getName, getParent, getPath, isAsset, isFolder
 

Method Detail

getLink

String getLink()
Returns a link to the binary of this asset; that is, a (partial) URL usable by client code to download the asset. Depending on the provider, this could return a URL that is relative to the current server (i.e no protocol, no hostname, but starts with a / and the context path), or an external URL including the protocol and host name. For some, this may mean generating a link to the DownloadServlet, for some it might mean something else entirely. Note: some provider may decide (based on configuration, perhaps), to *not* include the context path.


getTitle

String getTitle()

getSubject

String getSubject()

getDescription

String getDescription()

getCaption

String getCaption()

getLanguage

String getLanguage()

getCopyright

String getCopyright()

getComment

String getComment()

getCreated

Calendar getCreated()

getLastModified

Calendar getLastModified()

getMetadata

<M extends AssetMetadata> M getMetadata(Class<M> metaDataType)

getMimeType

String getMimeType()

getFileSize

long getFileSize()

getFileName

String getFileName()
Returns the "preferred" file name for this asset's binary. The returned name should include the file's extension (if any), but not its path.


getContentStream

InputStream getContentStream()
Opens an InputStream to the binary data of this Asset. Client code is responsible for closing it. TODO: throw IOException ?



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