public interface AssetCache
InputStream
s from and temporary
files for DAM asset renditions. A proper instance of an AssetCache
can
be retrieved via DamUtil.getAssetCache()
. Every obtained instance needs
to be release()
d after use.
The AssetCache might keep temporary files around for longer and reuse them in
future AssetCache
instances. This is transparent to the caller.
Modifier and Type | Method and Description |
---|---|
ByteSource |
getByteSource(Rendition rendition,
boolean needFile)
Get a
ByteSource for the renction's content. |
java.io.File |
getFile(Rendition rendition)
Get an
File with the content of the Asset rendition. |
java.io.InputStream |
getOriginalStream(Asset asset,
boolean needFile)
Get an InputStream to the content of the original Asset rendition.
|
java.io.InputStream |
getRenditionStream(Asset asset,
java.lang.String name,
boolean needFile)
Get an InputStream to the content of the Asset rendition with name.
|
java.io.InputStream |
getStream(Rendition rendition,
boolean needFile)
Get an InputStream to the content of the Asset rendition.
|
void |
invalidateCache(Asset asset)
Notify the cache that an asset has been modified/deleted and that cached data is
no longer valid
|
void |
invalidateCache(Rendition rendition)
Notify the cache that an asset rendition has been modified/deleted and that cached data is
no longer valid
|
void |
release()
Release this cache instance and cleanup all handed out streams and data.
|
java.io.InputStream getOriginalStream(Asset asset, boolean needFile) throws java.io.IOException
asset
- the asset to get the original rendition forneedFile
- if a file based stream is preferredjava.io.IOException
- if original rendition was not foundjava.io.InputStream getRenditionStream(Asset asset, java.lang.String name, boolean needFile) throws java.io.IOException
asset
- the asset to get the original rendition forname
- name of the rendition to get the content forneedFile
- if a file based stream is preferredjava.io.IOException
- if original rendition was not foundjava.io.InputStream getStream(Rendition rendition, boolean needFile) throws java.io.IOException
rendition
- rendition to get the content forneedFile
- if a file based stream is preferredjava.io.IOException
- if original rendition was not foundjava.io.File getFile(Rendition rendition) throws java.io.IOException
File
with the content of the Asset rendition. The file
is temporary and will be deleted on cache release (not necessarily the release
of this cache instance).rendition
- rendition to get the content forjava.io.IOException
- if original rendition was not foundByteSource getByteSource(Rendition rendition, boolean needFile) throws java.io.IOException
ByteSource
for the renction's content. The source is
automatically cleaned up on release of this cache instance.rendition
- rendition to get the content forneedFile
- if a file based stream is preferredjava.io.IOException
- if original rendition was not foundvoid invalidateCache(Asset asset)
asset
- asset that was modified/deleted.void invalidateCache(Rendition rendition)
rendition
- rendition that was modified/deleted.void release()
Copyright © 2010 - 2020 Adobe. All Rights Reserved