Package com.day.cq.dam.commons.util
Interface AssetCache
Deprecated.
In AEM as a Cloud Service, asset file manipulation should no longer occur directly in the JVM.
Instead, we recommend using the Asset Workflow Migration Tool to to migrate workflows to
Processing profiles.
Provides convenience methods for handling
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.
-
Method Summary
Modifier and TypeMethodDescriptiongetByteSource
(Rendition rendition, boolean needFile) Deprecated.Get aByteSource
for the renction's content.Deprecated.Get anFile
with the content of the Asset rendition.getOriginalStream
(Asset asset, boolean needFile) Deprecated.Get an InputStream to the content of the original Asset rendition.getRenditionStream
(Asset asset, String name, boolean needFile) Deprecated.Get an InputStream to the content of the Asset rendition with name.Deprecated.Get an InputStream to the content of the Asset rendition.void
invalidateCache
(Asset asset) Deprecated.Notify the cache that an asset has been modified/deleted and that cached data is no longer validvoid
invalidateCache
(Rendition rendition) Deprecated.Notify the cache that an asset rendition has been modified/deleted and that cached data is no longer validvoid
release()
Deprecated.Release this cache instance and cleanup all handed out streams and data.
-
Method Details
-
getOriginalStream
Deprecated.Get an InputStream to the content of the original Asset rendition. The stream is automatically closed on release of this cache instance.- Parameters:
asset
- the asset to get the original rendition forneedFile
- if a file based stream is preferred- Returns:
- stream to original rendition content, closed on release
- Throws:
IOException
- if original rendition was not found
-
getRenditionStream
Deprecated.Get an InputStream to the content of the Asset rendition with name. The stream is automatically closed on release of this cache instance.- Parameters:
asset
- the asset to get the original rendition forname
- name of the rendition to get the content forneedFile
- if a file based stream is preferred- Returns:
- stream to original rendition content, closed on release
- Throws:
IOException
- if original rendition was not found
-
getStream
Deprecated.Get an InputStream to the content of the Asset rendition. The stream is automatically closed on release of this cache instance.- Parameters:
rendition
- rendition to get the content forneedFile
- if a file based stream is preferred- Returns:
- stream to original rendition content, closed on release
- Throws:
IOException
- if original rendition was not found
-
getFile
Deprecated.Get anFile
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).- Parameters:
rendition
- rendition to get the content for- Returns:
- stream to original rendition content, closed on release
- Throws:
IOException
- if original rendition was not found
-
getByteSource
Deprecated.Get aByteSource
for the renction's content. The source is automatically cleaned up on release of this cache instance.- Parameters:
rendition
- rendition to get the content forneedFile
- if a file based stream is preferred- Returns:
- stream to original rendition content, closed on release
- Throws:
IOException
- if original rendition was not found
-
invalidateCache
Deprecated.Notify the cache that an asset has been modified/deleted and that cached data is no longer valid- Parameters:
asset
- asset that was modified/deleted.
-
invalidateCache
Deprecated.Notify the cache that an asset rendition has been modified/deleted and that cached data is no longer valid- Parameters:
rendition
- rendition that was modified/deleted.
-
release
void release()Deprecated.Release this cache instance and cleanup all handed out streams and data. Needs to be invoked at the end of cache use.
-