public class FileManagerService extends DefaultComponent implements FileManager
This is the component to request to perform transformations. See API.
Modifier and Type | Field and Description |
---|---|
static boolean |
DEF_VERSIONING_AFTER_ADD |
static VersioningOption |
DEF_VERSIONING_OPTION |
static String |
DEFAULT_FOLDER_TYPE_NAME |
static int |
MAX |
static ComponentName |
NAME |
static String |
QUERY |
Constructor and Description |
---|
FileManagerService() |
Modifier and Type | Method and Description |
---|---|
String |
computeDigest(Blob blob) |
DocumentModel |
createDocumentFromBlob(CoreSession documentManager,
Blob input,
String path,
boolean overwrite,
String fullName)
Returns an initialized doc based on a given blob.
|
DocumentModel |
createFolder(CoreSession documentManager,
String fullname,
String path)
Creates a Folder.
|
DocumentModel |
defaultCreateFolder(CoreSession documentManager,
String fullname,
String path) |
DocumentModel |
defaultCreateFolder(CoreSession documentManager,
String fullname,
String path,
String containerTypeName,
boolean checkAllowedSubTypes) |
boolean |
doVersioningAfterAdd()
Checks whether versioning should also be applied after a document is
added.
|
List<DocumentLocation> |
findExistingDocumentWithFile(CoreSession documentManager,
String path,
String digest,
Principal principal) |
DocumentModelList |
getCreationContainers(CoreSession documentManager,
String docType)
Returns the list of document that are to be suggested to the principal of
documentManager as a candidate container for a new document of type
docType.
|
DocumentModelList |
getCreationContainers(Principal principal,
String docType)
Returns the list of document that are to be suggested to principalName as
a candidate container for a new document of type docType on all
registered repositories.
|
String |
getDigestAlgorithm() |
List<String> |
getFields() |
FileImporter |
getPluginByName(String name) |
VersioningOption |
getVersioningOption()
Gets the versioning applied on an overwritten document before it is
overwritten.
|
boolean |
isDigestComputingEnabled() |
boolean |
isUnicityEnabled() |
void |
registerExtension(Extension extension)
Registers the given extension.
|
void |
unregisterExtension(Extension extension)
Unregisters the given extension.
|
DocumentModel |
updateDocumentFromBlob(CoreSession documentManager,
Blob input,
String path,
String fullName)
Just applies the same actions as creation but does not changes the doc
type.
|
activate, applicationStarted, deactivate, getAdapter, getApplicationStartedOrder, getLastModified, registerContribution, setLastModified, unregisterContribution
public static final ComponentName NAME
public static final String DEFAULT_FOLDER_TYPE_NAME
public static final String QUERY
public static final int MAX
public static final VersioningOption DEF_VERSIONING_OPTION
public static final boolean DEF_VERSIONING_AFTER_ADD
public DocumentModel createFolder(CoreSession documentManager, String fullname, String path) throws ClientException, IOException
FileManager
createFolder
in interface FileManager
fullname
- the full name of the folderpath
- the path were to create the folderClientException
IOException
public DocumentModel defaultCreateFolder(CoreSession documentManager, String fullname, String path) throws ClientException
ClientException
public DocumentModel defaultCreateFolder(CoreSession documentManager, String fullname, String path, String containerTypeName, boolean checkAllowedSubTypes) throws ClientException
ClientException
public DocumentModel createDocumentFromBlob(CoreSession documentManager, Blob input, String path, boolean overwrite, String fullName) throws IOException, ClientException
FileManager
createDocumentFromBlob
in interface FileManager
input
- the blob containing the content and the mime typepath
- the path were to create the documentoverwrite
- boolean how decide to overwrite or notfullName
- the fullname that contains the filenameIOException
ClientException
public DocumentModel updateDocumentFromBlob(CoreSession documentManager, Blob input, String path, String fullName) throws ClientException
FileManager
updateDocumentFromBlob
in interface FileManager
input
- the blob containing the content and the mime typepath
- the path to the file to updatefullName
- the full name that contains the filenameClientException
public FileImporter getPluginByName(String name)
public void registerExtension(Extension extension) throws Exception
Extensible
registerExtension
in interface Extensible
registerExtension
in class DefaultComponent
extension
- the extension to registerException
- if any error occurspublic void unregisterExtension(Extension extension) throws Exception
Extensible
unregisterExtension
in interface Extensible
unregisterExtension
in class DefaultComponent
extension
- the extension to unregisterException
- if any error occurspublic String computeDigest(Blob blob) throws NoSuchAlgorithmException, IOException
computeDigest
in interface FileManager
NoSuchAlgorithmException
IOException
public List<DocumentLocation> findExistingDocumentWithFile(CoreSession documentManager, String path, String digest, Principal principal) throws ClientException
findExistingDocumentWithFile
in interface FileManager
ClientException
public boolean isUnicityEnabled()
isUnicityEnabled
in interface FileManager
public boolean isDigestComputingEnabled()
isDigestComputingEnabled
in interface FileManager
public List<String> getFields()
getFields
in interface FileManager
public DocumentModelList getCreationContainers(Principal principal, String docType) throws Exception
FileManager
getCreationContainers
in interface FileManager
Exception
public DocumentModelList getCreationContainers(CoreSession documentManager, String docType) throws Exception
FileManager
getCreationContainers
in interface FileManager
Exception
public String getDigestAlgorithm()
getDigestAlgorithm
in interface FileManager
public VersioningOption getVersioningOption()
FileManager
getVersioningOption
in interface FileManager
public boolean doVersioningAfterAdd()
FileManager
doVersioningAfterAdd
in interface FileManager
Copyright © 2013 Nuxeo SA. All Rights Reserved.