public class SimpleFileSystemContentStorage extends Object implements ContentStorage
ContentStorage that relies on the passed metadata to store content.
Under a root folder, a division between 'task' and 'process-instance' content is made. New content gets a new UUID assigned and is placed in one of these folders.
The id of the returned ContentObject indicates in which folder it is stored.| Modifier and Type | Class and Description |
|---|---|
protected static class |
SimpleFileSystemContentStorage.MapBasedContentObjectStorageMetadata |
| Modifier and Type | Field and Description |
|---|---|
static String |
CASE_PREFIX |
protected File |
caseFolder |
protected File |
contentFolderRoot |
static String |
PROCESS_INSTANCE_PREFIX |
protected File |
processInstanceFolder |
static String |
TASK_PREFIX |
protected File |
taskFolder |
static String |
TYPE_CASE_INSTANCE |
static String |
TYPE_PROCESS_INSTANCE |
static String |
TYPE_TASK |
static String |
TYPE_UNCATEGORIZED |
static String |
UNCATEGORIZED_PREFIX |
protected File |
uncategorizedFolder |
| Constructor and Description |
|---|
SimpleFileSystemContentStorage(File contentFolderRoot) |
public static final String TYPE_TASK
public static final String TYPE_PROCESS_INSTANCE
public static final String TYPE_CASE_INSTANCE
public static final String TYPE_UNCATEGORIZED
public static final String TASK_PREFIX
public static final String PROCESS_INSTANCE_PREFIX
public static final String CASE_PREFIX
public static final String UNCATEGORIZED_PREFIX
protected File contentFolderRoot
protected File taskFolder
protected File processInstanceFolder
protected File caseFolder
protected File uncategorizedFolder
public SimpleFileSystemContentStorage(File contentFolderRoot)
protected void validateOrCreateSubfolders()
@Deprecated public ContentObject createContentObject(InputStream contentStream, Map<String,Object> metaData)
createContentObject in interface ContentStoragemetaData - A key-value collection that can be used to change the way the content is stored.InputStream and stores it. Returns a ContentObject with a unique id generated - which can be used for reading the content again.public ContentObject createContentObject(InputStream contentStream, ContentObjectStorageMetadata metaData)
ContentStorageInputStream and stores it.createContentObject in interface ContentStoragecontentStream - the content stream that should be storedmetaData - additional data that can be used to change the way the content is storedContentObject with a unique id generated - which can be used for reading the content againprotected String generateContentId(String uuid, ContentObjectStorageMetadata metaData)
@Deprecated public ContentObject updateContentObject(String id, InputStream contentStream, Map<String,Object> metaData)
ContentStorageupdateContentObject in interface ContentStoragemetaData - A key-value collection that can be used to change the way the content is stored.ContentObject with a unique id generated - which can br used for reading the content again.public ContentObject updateContentObject(String id, InputStream contentStream, ContentObjectStorageMetadata metaData)
ContentStorageupdateContentObject in interface ContentStorageid - the id of the content being updatedcontentStream - the content stream that should be updatedmetaData - additional data that can be used to change the way the content is storedContentObject with a unique id generated - which can br used for reading the content again.public ContentObject getContentObject(String id)
getContentObject in interface ContentStorageContentObject with the given id.public Map<String,Object> getMetaData()
getMetaData in interface ContentStorageContentObjectpublic void deleteContentObject(String id)
ContentStoragedeleteContentObject in interface ContentStoragepublic String getContentStoreName()
getContentStoreName in interface ContentStorageprotected File getContentFile(ContentObjectStorageMetadata metaData, String contentId)
protected String determineType(ContentObjectStorageMetadata metaData)
protected File createOrGetFolderBasedOnMetaData(ContentObjectStorageMetadata metaData)
Copyright © 2023 Flowable. All rights reserved.