public class DocumentContentConverterService extends Object implements com.edorasware.commons.core.util.service.Service, org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
Modifier and Type | Field and Description |
---|---|
static DocumentContentInfo |
EMPTY_DOCUMENT_CONTENT_INFO |
Constructor and Description |
---|
DocumentContentConverterService(ContentService contentService,
com.edorasware.commons.core.any.AnyWorkObjectService anyWorkObjectService,
String cacheTempPath,
String tempFileNamePrefix,
List<DocumentContentConverter> contentConverters,
com.edorasware.one.cache.OneCache oneCache) |
Modifier and Type | Method and Description |
---|---|
protected void |
ensureTemporaryDirectory(String temporaryDirectoryPath) |
void |
evictCachedFile(com.edorasware.commons.core.entity.WorkObjectId id)
Evict the cached file from the corresponding WorkObject.
|
DocumentContent |
getConvertedContent(com.edorasware.commons.core.entity.WorkObjectId id) |
DocumentContentInfo |
getConvertedContentInfo(com.edorasware.commons.core.any.AnyWorkObjectId id) |
protected String |
getDefaultBaseDirectory()
Returns the default base directory for content providers with a trailing separator.
|
void |
init() |
boolean |
isConvertible(com.edorasware.commons.core.any.AnyWorkObject workObject) |
void |
onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
clean up temp directory files in the case of context refresh event.
|
protected void |
shutdown()
Clean up the cache and remove all temporary files
|
public static final DocumentContentInfo EMPTY_DOCUMENT_CONTENT_INFO
public DocumentContentConverterService(ContentService contentService, com.edorasware.commons.core.any.AnyWorkObjectService anyWorkObjectService, String cacheTempPath, String tempFileNamePrefix, List<DocumentContentConverter> contentConverters, com.edorasware.one.cache.OneCache oneCache)
contentService
- content service to use for obtaining contentanyWorkObjectService
- workobject service for resolving workobjectscacheTempPath
- directory in which temporary converted content is stored. If null or empty default path (${edoras-one.home}/temp) is used. Directory is always
cleaned up on the spring application context refresh.tempFileNamePrefix
- file name prefix used for cached files (can be empty)contentConverters
- converters to use for content conversiononeCache
- One cache.public void init()
init
in interface com.edorasware.commons.core.util.service.Service
public DocumentContent getConvertedContent(com.edorasware.commons.core.entity.WorkObjectId id)
public DocumentContentInfo getConvertedContentInfo(com.edorasware.commons.core.any.AnyWorkObjectId id)
public boolean isConvertible(com.edorasware.commons.core.any.AnyWorkObject workObject)
public void onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
event
- context refresh eventprotected void shutdown()
protected void ensureTemporaryDirectory(String temporaryDirectoryPath)
protected String getDefaultBaseDirectory()
public void evictCachedFile(com.edorasware.commons.core.entity.WorkObjectId id)
id
- Copyright © 2010 - 2015 edorasware ag. All Rights Reserved.