Class SimpleFileSystemContentStorage
- java.lang.Object
-
- com.flowable.content.engine.impl.fs.SimpleFileSystemContentStorage
-
- All Implemented Interfaces:
org.flowable.content.api.ContentStorage
public class SimpleFileSystemContentStorage extends java.lang.Object implements org.flowable.content.api.ContentStorage
(Very) simple implementation of theContentStorage
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 returnedContentObject
indicates in which folder it is stored.- Author:
- Joram Barrez
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
SimpleFileSystemContentStorage.MapBasedContentObjectStorageMetadata
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CASE_PREFIX
protected java.io.File
caseFolder
protected java.io.File
contentFolderRoot
static java.lang.String
PROCESS_INSTANCE_PREFIX
protected java.io.File
processInstanceFolder
static java.lang.String
TASK_PREFIX
protected java.io.File
taskFolder
static java.lang.String
TYPE_CASE_INSTANCE
static java.lang.String
TYPE_PROCESS_INSTANCE
static java.lang.String
TYPE_TASK
static java.lang.String
TYPE_UNCATEGORIZED
static java.lang.String
UNCATEGORIZED_PREFIX
protected java.io.File
uncategorizedFolder
-
Constructor Summary
Constructors Constructor Description SimpleFileSystemContentStorage(java.io.File contentFolderRoot)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.flowable.content.api.ContentObject
createContentObject(java.io.InputStream contentStream, java.util.Map<java.lang.String,java.lang.Object> metadata)
org.flowable.content.api.ContentObject
createContentObject(java.io.InputStream contentStream, org.flowable.content.api.ContentObjectStorageMetadata metaData)
protected java.io.File
createOrGetFolderBasedOnMetaData(org.flowable.content.api.ContentObjectStorageMetadata metaData)
void
deleteContentObject(java.lang.String id)
protected java.lang.String
determineType(org.flowable.content.api.ContentObjectStorageMetadata metaData)
protected java.lang.String
generateContentId(java.lang.String uuid, org.flowable.content.api.ContentObjectStorageMetadata metadata)
protected java.io.File
getContentFile(java.lang.String id)
protected java.io.File
getContentFile(org.flowable.content.api.ContentObjectStorageMetadata metaData, java.lang.String contentId)
org.flowable.content.api.ContentObject
getContentObject(java.lang.String id)
java.lang.String
getContentStoreName()
java.util.Map<java.lang.String,java.lang.Object>
getMetaData()
protected java.io.File
internalCreateOrGetFolder(java.io.File parentFolder, java.lang.String id)
org.flowable.content.api.ContentObject
updateContentObject(java.lang.String id, java.io.InputStream contentStream, java.util.Map<java.lang.String,java.lang.Object> metaData)
org.flowable.content.api.ContentObject
updateContentObject(java.lang.String id, java.io.InputStream contentStream, org.flowable.content.api.ContentObjectStorageMetadata metaData)
protected java.io.File
validateOrCreateFolder(java.lang.String folderName)
protected void
validateOrCreateSubfolders()
-
-
-
Field Detail
-
TYPE_TASK
public static final java.lang.String TYPE_TASK
- See Also:
- Constant Field Values
-
TYPE_PROCESS_INSTANCE
public static final java.lang.String TYPE_PROCESS_INSTANCE
- See Also:
- Constant Field Values
-
TYPE_CASE_INSTANCE
public static final java.lang.String TYPE_CASE_INSTANCE
- See Also:
- Constant Field Values
-
TYPE_UNCATEGORIZED
public static final java.lang.String TYPE_UNCATEGORIZED
- See Also:
- Constant Field Values
-
TASK_PREFIX
public static final java.lang.String TASK_PREFIX
- See Also:
- Constant Field Values
-
PROCESS_INSTANCE_PREFIX
public static final java.lang.String PROCESS_INSTANCE_PREFIX
- See Also:
- Constant Field Values
-
CASE_PREFIX
public static final java.lang.String CASE_PREFIX
- See Also:
- Constant Field Values
-
UNCATEGORIZED_PREFIX
public static final java.lang.String UNCATEGORIZED_PREFIX
- See Also:
- Constant Field Values
-
contentFolderRoot
protected java.io.File contentFolderRoot
-
taskFolder
protected java.io.File taskFolder
-
processInstanceFolder
protected java.io.File processInstanceFolder
-
caseFolder
protected java.io.File caseFolder
-
uncategorizedFolder
protected java.io.File uncategorizedFolder
-
-
Method Detail
-
validateOrCreateSubfolders
protected void validateOrCreateSubfolders()
-
validateOrCreateFolder
protected java.io.File validateOrCreateFolder(java.lang.String folderName)
-
createContentObject
public org.flowable.content.api.ContentObject createContentObject(java.io.InputStream contentStream, java.util.Map<java.lang.String,java.lang.Object> metadata)
- Specified by:
createContentObject
in interfaceorg.flowable.content.api.ContentStorage
-
createContentObject
public org.flowable.content.api.ContentObject createContentObject(java.io.InputStream contentStream, org.flowable.content.api.ContentObjectStorageMetadata metaData)
- Specified by:
createContentObject
in interfaceorg.flowable.content.api.ContentStorage
-
generateContentId
protected java.lang.String generateContentId(java.lang.String uuid, org.flowable.content.api.ContentObjectStorageMetadata metadata)
-
updateContentObject
public org.flowable.content.api.ContentObject updateContentObject(java.lang.String id, java.io.InputStream contentStream, java.util.Map<java.lang.String,java.lang.Object> metaData)
- Specified by:
updateContentObject
in interfaceorg.flowable.content.api.ContentStorage
-
updateContentObject
public org.flowable.content.api.ContentObject updateContentObject(java.lang.String id, java.io.InputStream contentStream, org.flowable.content.api.ContentObjectStorageMetadata metaData)
- Specified by:
updateContentObject
in interfaceorg.flowable.content.api.ContentStorage
-
getContentObject
public org.flowable.content.api.ContentObject getContentObject(java.lang.String id)
- Specified by:
getContentObject
in interfaceorg.flowable.content.api.ContentStorage
-
getContentFile
protected java.io.File getContentFile(java.lang.String id)
-
getMetaData
public java.util.Map<java.lang.String,java.lang.Object> getMetaData()
- Specified by:
getMetaData
in interfaceorg.flowable.content.api.ContentStorage
-
deleteContentObject
public void deleteContentObject(java.lang.String id)
- Specified by:
deleteContentObject
in interfaceorg.flowable.content.api.ContentStorage
-
getContentStoreName
public java.lang.String getContentStoreName()
- Specified by:
getContentStoreName
in interfaceorg.flowable.content.api.ContentStorage
-
getContentFile
protected java.io.File getContentFile(org.flowable.content.api.ContentObjectStorageMetadata metaData, java.lang.String contentId)
-
determineType
protected java.lang.String determineType(org.flowable.content.api.ContentObjectStorageMetadata metaData)
-
createOrGetFolderBasedOnMetaData
protected java.io.File createOrGetFolderBasedOnMetaData(org.flowable.content.api.ContentObjectStorageMetadata metaData)
-
internalCreateOrGetFolder
protected java.io.File internalCreateOrGetFolder(java.io.File parentFolder, java.lang.String id)
-
-