Class FileSystemContentStorage

java.lang.Object
com.flowable.content.engine.impl.fs.FileSystemContentStorage
All Implemented Interfaces:
org.flowable.content.api.ContentStorage

public class FileSystemContentStorage
extends java.lang.Object
implements org.flowable.content.api.ContentStorage
Note that this implementation of the ContentStorage interface doesn't do anything with the passed metadata, nor returns it when requested!
Author:
Frederik Heremans, Joram Barrez
  • Constructor Summary

    Constructors 
    Constructor Description
    FileSystemContentStorage​(java.io.File contentFolderRoot, int blockSize, int depth)  
  • Method Summary

    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)  
    void deleteContentObject​(java.lang.String id)  
    protected java.math.BigInteger fetchNewId()  
    org.flowable.content.api.ContentObject getContentObject​(java.lang.String id)  
    java.lang.String getContentStoreName()  
    protected java.io.File getFileForId​(java.lang.String id, boolean shouldExist)  
    protected java.io.File getFirstAvailableFolder​(int maxRetries)  
    protected java.io.File getMaxChild​(java.io.File file)  
    java.util.Map<java.lang.String,​java.lang.Object> getMetaData()  
    org.flowable.content.api.ContentObject updateContentObject​(java.lang.String id, java.io.InputStream contentStream, java.util.Map<java.lang.String,​java.lang.Object> metaData)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FileSystemContentStorage

      public FileSystemContentStorage​(java.io.File contentFolderRoot, int blockSize, int depth)
      Parameters:
      contentFolderRoot - root folder where all content will be stored in
      blockSize - max size of a single folder's children
      depth - depth of the tree created to store content in
      See Also:
      PathConverter
  • Method Details

    • 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 interface org.flowable.content.api.ContentStorage
    • getContentObject

      public org.flowable.content.api.ContentObject getContentObject​(java.lang.String id)
      Specified by:
      getContentObject in interface org.flowable.content.api.ContentStorage
    • getMetaData

      public java.util.Map<java.lang.String,​java.lang.Object> getMetaData()
      Specified by:
      getMetaData in interface org.flowable.content.api.ContentStorage
    • 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 interface org.flowable.content.api.ContentStorage
    • deleteContentObject

      public void deleteContentObject​(java.lang.String id)
      Specified by:
      deleteContentObject in interface org.flowable.content.api.ContentStorage
    • getContentStoreName

      public java.lang.String getContentStoreName()
      Specified by:
      getContentStoreName in interface org.flowable.content.api.ContentStorage
    • getFileForId

      protected java.io.File getFileForId​(java.lang.String id, boolean shouldExist)
      Returns:
      a file reference for the given id, checking for existence based on the given flag.
    • fetchNewId

      protected java.math.BigInteger fetchNewId()
    • getFirstAvailableFolder

      protected java.io.File getFirstAvailableFolder​(int maxRetries)
    • getMaxChild

      protected java.io.File getMaxChild​(java.io.File file)