Class PostToFileCenter

java.lang.Object
com.vdoc.sdk.commons.io.filecenter.PostToFileCenter

public class PostToFileCenter extends Object
Post to FileCenter
Author:
famaridon
  • Constructor Details

    • PostToFileCenter

      public PostToFileCenter()
      create with default configuration

      overwriting = true autoCreateFolder = true

    • PostToFileCenter

      public PostToFileCenter(boolean autoCreateFolder, boolean overwriting)
      Constructor
      Parameters:
      autoCreateFolder - set the autoCreateFolder mode (default true)
      overwriting - set the overwriting mode (default true);
  • Method Details

    • isOverwriting

      public boolean isOverwriting()
      Returns:
      true if file overwriting is enable
    • setOverwriting

      public void setOverwriting(boolean overwriting)
      Set the overwriting mode if it's set at true if a file exist in FileCenter the file will be checkOut and checkIn with the attachment
    • isAutoCreateFolder

      public boolean isAutoCreateFolder()
      Returns:
      true if file AutoCreateFolder is enable
    • setAutoCreateFolder

      public void setAutoCreateFolder(boolean autoCreateFolder)
      set AutoCreateFolder mode if it's set at true if a folder can't be found we create it
    • postToFileCenter

      public List<IFile> postToFileCenter(ILibraryModule libraryModule, IContext context, IFolder folder, Collection<ICopyable> attachments)
      Copy all element of attachments in FileCenter on the define folder
      Parameters:
      libraryModule - a ILibraryModule
      context - the context with which create file
      folder - the folder where put file
      attachments - a list of attachment to put in FileCenter
      Returns:
      list of created file
    • postToFileCenter

      public List<IFile> postToFileCenter(ILibraryModule libraryModule, IContext context, ILibrary library, Collection<ICopyable> attachments)
      Copy all element of attachments in FileCenter on the define library
      Parameters:
      libraryModule - a ILibraryModule
      context - the context with which create file
      library - the library where put file
      attachments - a list of attachment to put in FileCenter
      Returns:
      list of created file
    • postToFileCenter

      public List<IFile> postToFileCenter(ILibraryModule libraryModule, IContext context, ILibrary library, String path, Collection<ICopyable> attachments) throws FileNotFoundException
      Copy all element of attachments in FileCenter on the define path
      Parameters:
      libraryModule - a ILibraryModule
      context - the context with which create file
      library - the library where put file
      path - a String that represent folder full path
      attachments - a list of attachment to put in FileCenter
      Returns:
      list of created file
      Throws:
      FileNotFoundException - is throw if autoCreateFolder = false and the folder define by the path doesn't exist
    • buildFolder

      public IFolder buildFolder(ILibraryModule libraryModule, IContext context, ILibrary library, String path)
      build a full path and return the last created folder
      Parameters:
      libraryModule - a libraryModule to build the path
      context - a context
      library - the base of path
      path - the full path
      Returns:
      the new IFolder or null if it can't be created