Class PostToFileCenter
java.lang.Object
com.vdoc.sdk.commons.io.filecenter.PostToFileCenter
Post to FileCenter
- Author:
- famaridon
-
Constructor Summary
ConstructorsConstructorDescriptioncreate with default configurationPostToFileCenter(boolean autoCreateFolder, boolean overwriting) Constructor -
Method Summary
Modifier and TypeMethodDescriptionbuildFolder(ILibraryModule libraryModule, IContext context, ILibrary library, String path) build a full path and return the last created folderbooleanbooleanpostToFileCenter(ILibraryModule libraryModule, IContext context, IFolder folder, Collection<ICopyable> attachments) Copy all element of attachments in FileCenter on the define folderpostToFileCenter(ILibraryModule libraryModule, IContext context, ILibrary library, String path, Collection<ICopyable> attachments) Copy all element of attachments in FileCenter on the define pathpostToFileCenter(ILibraryModule libraryModule, IContext context, ILibrary library, Collection<ICopyable> attachments) Copy all element of attachments in FileCenter on the define libraryvoidsetAutoCreateFolder(boolean autoCreateFolder) set AutoCreateFolder mode if it's set at true if a folder can't be found we create itvoidsetOverwriting(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
-
Constructor Details
-
PostToFileCenter
public PostToFileCenter()create with default configurationoverwriting = 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 ILibraryModulecontext- the context with which create filefolder- the folder where put fileattachments- 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 ILibraryModulecontext- the context with which create filelibrary- the library where put fileattachments- 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 ILibraryModulecontext- the context with which create filelibrary- the library where put filepath- a String that represent folder full pathattachments- 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 pathcontext- a contextlibrary- the base of pathpath- the full path- Returns:
- the new IFolder or null if it can't be created
-