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 theContentStoragethat 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 returnedContentObjectindicates in which folder it is stored.- Author:
- Joram Barrez
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classSimpleFileSystemContentStorage.MapBasedContentObjectStorageMetadata
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCASE_PREFIXprotected java.io.FilecaseFolderprotected java.io.FilecontentFolderRootstatic java.lang.StringPROCESS_INSTANCE_PREFIXprotected java.io.FileprocessInstanceFolderstatic java.lang.StringTASK_PREFIXprotected java.io.FiletaskFolderstatic java.lang.StringTYPE_CASE_INSTANCEstatic java.lang.StringTYPE_PROCESS_INSTANCEstatic java.lang.StringTYPE_TASKstatic java.lang.StringTYPE_UNCATEGORIZEDstatic java.lang.StringUNCATEGORIZED_PREFIXprotected java.io.FileuncategorizedFolder
-
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.ContentObjectcreateContentObject(java.io.InputStream contentStream, java.util.Map<java.lang.String,java.lang.Object> metadata)org.flowable.content.api.ContentObjectcreateContentObject(java.io.InputStream contentStream, org.flowable.content.api.ContentObjectStorageMetadata metaData)protected java.io.FilecreateOrGetFolderBasedOnMetaData(org.flowable.content.api.ContentObjectStorageMetadata metaData)voiddeleteContentObject(java.lang.String id)protected java.lang.StringdetermineType(org.flowable.content.api.ContentObjectStorageMetadata metaData)protected java.lang.StringgenerateContentId(java.lang.String uuid, org.flowable.content.api.ContentObjectStorageMetadata metadata)protected java.io.FilegetContentFile(java.lang.String id)protected java.io.FilegetContentFile(org.flowable.content.api.ContentObjectStorageMetadata metaData, java.lang.String contentId)org.flowable.content.api.ContentObjectgetContentObject(java.lang.String id)java.lang.StringgetContentStoreName()java.util.Map<java.lang.String,java.lang.Object>getMetaData()protected java.io.FileinternalCreateOrGetFolder(java.io.File parentFolder, java.lang.String id)org.flowable.content.api.ContentObjectupdateContentObject(java.lang.String id, java.io.InputStream contentStream, java.util.Map<java.lang.String,java.lang.Object> metaData)org.flowable.content.api.ContentObjectupdateContentObject(java.lang.String id, java.io.InputStream contentStream, org.flowable.content.api.ContentObjectStorageMetadata metaData)protected java.io.FilevalidateOrCreateFolder(java.lang.String folderName)protected voidvalidateOrCreateSubfolders()
-
-
-
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:
createContentObjectin 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:
createContentObjectin 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:
updateContentObjectin 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:
updateContentObjectin interfaceorg.flowable.content.api.ContentStorage
-
getContentObject
public org.flowable.content.api.ContentObject getContentObject(java.lang.String id)
- Specified by:
getContentObjectin 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:
getMetaDatain interfaceorg.flowable.content.api.ContentStorage
-
deleteContentObject
public void deleteContentObject(java.lang.String id)
- Specified by:
deleteContentObjectin interfaceorg.flowable.content.api.ContentStorage
-
getContentStoreName
public java.lang.String getContentStoreName()
- Specified by:
getContentStoreNamein 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)
-
-