Class FileManagerService
java.lang.Object
org.nuxeo.runtime.model.DefaultComponent
org.nuxeo.ecm.platform.filemanager.service.FileManagerService
- All Implemented Interfaces:
FileManager
,Adaptable
,Component
,Extensible
,TimestampedService
FileManager registry service.
This is the component to request to perform transformations. See API.
- Author:
- Andreas Kalogeropoulos
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
static final int
static final ComponentName
static final String
static final String
static final String
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
computePluginsExtensionPoint
(Class<?> klass) createDocumentFromBlob
(CoreSession documentManager, Blob input, String path, boolean overwrite, String fullName) Returns an initialized doc based on a given blob.createDocumentFromBlob
(CoreSession documentManager, Blob input, String path, boolean overwrite, String fullName, boolean noMimeTypeCheck) Returns an initialized doc based on a given blob.createFolder
(CoreSession documentManager, String fullname, String path, boolean overwrite) Creates a Folder.Returns a created or updated document based on the givencontext
.defaultCreateFolder
(CoreSession documentManager, String fullname, String path, boolean overwrite) defaultCreateFolder
(CoreSession documentManager, String fullname, String path, String containerTypeName, boolean checkAllowedSubTypes, boolean overwrite) findExistingDocumentWithFile
(CoreSession documentManager, String path, String digest, NuxeoPrincipal principal) 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.getCreationContainers
(NuxeoPrincipal 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.getPluginByName
(String name) boolean
protected boolean
isImporterAvailable
(FileImporter importer, String normalizedMimeType, String mimeType, boolean excludeOneToMany) boolean
void
registerContribution
(Object contribution, String xp, ComponentInstance component) protected void
protected void
protected void
protected void
void
start
(ComponentContext context) Start the component.void
unregisterContribution
(Object contribution, String xp, ComponentInstance component) updateDocumentFromBlob
(CoreSession documentManager, Blob input, String path, String fullName) Just applies the same actions as creation but does not changes the doc type.Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, stop, unregister, unregisterExtension
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.runtime.model.Component
getApplicationStartedOrder
-
Field Details
-
NAME
-
DEFAULT_FOLDER_TYPE_NAME
- See Also:
-
QUERY
- See Also:
-
MAX
public static final int MAX- See Also:
-
PLUGINS_EP
- Since:
- 11.1
- See Also:
-
UNICITY_EP
- Since:
- 11.1
- See Also:
-
-
Constructor Details
-
FileManagerService
public FileManagerService()
-
-
Method Details
-
registerContribution
- Overrides:
registerContribution
in classDefaultComponent
-
unregisterContribution
- Overrides:
unregisterContribution
in classDefaultComponent
-
start
Description copied from interface:Component
Start the component. This method is called after all the components were resolved and activated- Specified by:
start
in interfaceComponent
- Overrides:
start
in classDefaultComponent
-
registerFileImporters
protected void registerFileImporters() -
registerFolderImporters
protected void registerFolderImporters() -
registerCreationContainerListProviders
protected void registerCreationContainerListProviders() -
registerUnicity
protected void registerUnicity() -
computePluginsExtensionPoint
-
createFolder
public DocumentModel createFolder(CoreSession documentManager, String fullname, String path, boolean overwrite) throws IOException Description copied from interface:FileManager
Creates a Folder.- Specified by:
createFolder
in interfaceFileManager
fullname
- the full name of the folderpath
- the path were to create the folderoverwrite
- whether to overwrite an existing folder with the same title or not- Returns:
- the Folder Created
- Throws:
IOException
-
defaultCreateFolder
public DocumentModel defaultCreateFolder(CoreSession documentManager, String fullname, String path, boolean overwrite) - Since:
- 9.1
-
defaultCreateFolder
public DocumentModel defaultCreateFolder(CoreSession documentManager, String fullname, String path, String containerTypeName, boolean checkAllowedSubTypes, boolean overwrite) - Since:
- 9.1
-
createDocumentFromBlob
public DocumentModel createDocumentFromBlob(CoreSession documentManager, Blob input, String path, boolean overwrite, String fullName) throws IOException Description copied from interface:FileManager
Returns an initialized doc based on a given blob.- Specified by:
createDocumentFromBlob
in interfaceFileManager
input
- the blob containing the content and the mime typepath
- the path were to create the documentoverwrite
- whether to overwrite an existing file with the same title or notfullName
- the fullname that contains the filename- Returns:
- the created Document
- Throws:
IOException
-
createDocumentFromBlob
public DocumentModel createDocumentFromBlob(CoreSession documentManager, Blob input, String path, boolean overwrite, String fullName, boolean noMimeTypeCheck) throws IOException Description copied from interface:FileManager
Returns an initialized doc based on a given blob.- Specified by:
createDocumentFromBlob
in interfaceFileManager
input
- the blob containing the content and the mime typepath
- the path were to create the documentoverwrite
- whether to overwrite an existing file with the same title or notfullName
- the fullname that contains the filenamenoMimeTypeCheck
- true if the blob's mime-type doesn't have to be checked against fullName- Returns:
- the created Document
- Throws:
IOException
-
createOrUpdateDocument
Description copied from interface:FileManager
Returns a created or updated document based on the givencontext
.The document may not be persisted according to
FileImporterContext.isPersistDocument()
. That's the caller's responsibility to actually persist the document.Note that file importers may not use
FileImporterContext.isPersistDocument()
and always persist the document.- Specified by:
createOrUpdateDocument
in interfaceFileManager
- Returns:
- the created or updated document
- Throws:
IOException
- See Also:
-
isImporterAvailable
protected boolean isImporterAvailable(FileImporter importer, String normalizedMimeType, String mimeType, boolean excludeOneToMany) -
updateDocumentFromBlob
public DocumentModel updateDocumentFromBlob(CoreSession documentManager, Blob input, String path, String fullName) Description copied from interface:FileManager
Just applies the same actions as creation but does not changes the doc type.- Specified by:
updateDocumentFromBlob
in interfaceFileManager
input
- the blob containing the content and the mime typepath
- the path to the file to updatefullName
- the full name that contains the filename- Returns:
- the updated Document
-
getPluginByName
-
findExistingDocumentWithFile
public List<DocumentLocation> findExistingDocumentWithFile(CoreSession documentManager, String path, String digest, NuxeoPrincipal principal) - Specified by:
findExistingDocumentWithFile
in interfaceFileManager
-
isUnicityEnabled
public boolean isUnicityEnabled()- Specified by:
isUnicityEnabled
in interfaceFileManager
-
isDigestComputingEnabled
public boolean isDigestComputingEnabled()- Specified by:
isDigestComputingEnabled
in interfaceFileManager
-
getFields
- Specified by:
getFields
in interfaceFileManager
-
getCreationContainers
Description copied from interface:FileManager
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.- Specified by:
getCreationContainers
in interfaceFileManager
- Returns:
- the list of candidate containers
-
getCreationContainers
Description copied from interface:FileManager
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.- Specified by:
getCreationContainers
in interfaceFileManager
- Returns:
- the list of candidate containers
-
getDigestAlgorithm
- Specified by:
getDigestAlgorithm
in interfaceFileManager
-