Modifier | Constructor and Description |
---|---|
protected |
AssetDecorator(Asset decorated) |
Modifier and Type | Method and Description |
---|---|
AssetProvider |
getAssetProvider() |
String |
getCaption() |
String |
getComment() |
InputStream |
getContentStream()
Opens an
InputStream to the binary data of this Asset. |
String |
getCopyright() |
Calendar |
getCreated() |
Asset |
getDecorated() |
String |
getDescription() |
String |
getFileName()
Returns the "preferred" file name for this asset's binary.
|
long |
getFileSize() |
ItemKey |
getItemKey() |
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> |
getMetadata(Class<M> metaDataType) |
String |
getMimeType() |
String |
getName()
Returns the name of this item; this same name should be usable by
Folder.getItem(String) . |
Folder |
getParent()
|
String |
getPath()
Returns the canonical path to this item; in case an item is reachable by several paths, this would return the
principal path that the
AssetProvider knows. |
String |
getSubject() |
String |
getTitle() |
boolean |
isAsset()
A slightly more elegant way of doing (i instanceof Asset).
|
boolean |
isFolder()
A slightly more elegant way of doing (i instanceof Folder).
|
<M extends AssetMetadata> |
supports(Class<M> metaDataType) |
static Asset |
unwrap(Asset asset) |
protected AssetDecorator(Asset decorated)
public Asset getDecorated()
public ItemKey getItemKey()
getItemKey
in interface Item
public AssetProvider getAssetProvider()
getAssetProvider
in interface Item
public String getLink()
Asset
public String getSubject()
getSubject
in interface Asset
public String getDescription()
getDescription
in interface Asset
public String getCaption()
getCaption
in interface Asset
public String getLanguage()
getLanguage
in interface Asset
public String getCopyright()
getCopyright
in interface Asset
public String getComment()
getComment
in interface Asset
public Calendar getCreated()
getCreated
in interface Asset
public Calendar getLastModified()
getLastModified
in interface Asset
public <M extends AssetMetadata> M getMetadata(Class<M> metaDataType)
getMetadata
in interface Asset
public String getMimeType()
getMimeType
in interface Asset
public long getFileSize()
getFileSize
in interface Asset
public InputStream getContentStream()
Asset
InputStream
to the binary data of this Asset. Client code is responsible for closing it.
TODO: throw IOException ?getContentStream
in interface Asset
public String getFileName()
Asset
getFileName
in interface Asset
public String getPath()
Item
AssetProvider
knows.
Note: some providers might hide or show only a subsection of their actual data. This should return the path
"relative" to that subsection.public String getName()
Item
Folder.getItem(String)
.public boolean isFolder()
Item
public boolean isAsset()
Item
public <M extends AssetMetadata> boolean supports(Class<M> metaDataType)
Copyright © 2017 Magnolia International Ltd.. All rights reserved.