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
public class FileManagerService extends DefaultComponent implements FileManager
FileManager registry service.This is the component to request to perform transformations. See API.
- Author:
- Andreas Kalogeropoulos
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEF_VERSIONING_AFTER_ADDstatic VersioningOptionDEF_VERSIONING_OPTIONstatic StringDEFAULT_FOLDER_TYPE_NAMEstatic intMAXstatic ComponentNameNAMEstatic StringPLUGINS_EPstatic StringQUERYstatic StringUNICITY_EPstatic StringVERSIONING_EP-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description FileManagerService()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected StringcomputePluginsExtensionPoint(Class<?> klass)DocumentModelcreateDocumentFromBlob(CoreSession documentManager, Blob input, String path, boolean overwrite, String fullName)Returns an initialized doc based on a given blob.DocumentModelcreateDocumentFromBlob(CoreSession documentManager, Blob input, String path, boolean overwrite, String fullName, boolean noMimeTypeCheck)Returns an initialized doc based on a given blob.DocumentModelcreateFolder(CoreSession documentManager, String fullname, String path, boolean overwrite)Creates a Folder.DocumentModelcreateOrUpdateDocument(FileImporterContext context)Returns a created or updated document based on the givencontext.DocumentModeldefaultCreateFolder(CoreSession documentManager, String fullname, String path)Deprecated.since 9.1, usedefaultCreateFolder(CoreSession, String, String, boolean)insteadDocumentModeldefaultCreateFolder(CoreSession documentManager, String fullname, String path, boolean overwrite)DocumentModeldefaultCreateFolder(CoreSession documentManager, String fullname, String path, String containerTypeName, boolean checkAllowedSubTypes)Deprecated.since 9.1, usedefaultCreateFolder(CoreSession, String, String, String, boolean, boolean)insteadDocumentModeldefaultCreateFolder(CoreSession documentManager, String fullname, String path, String containerTypeName, boolean checkAllowedSubTypes, boolean overwrite)booleandoVersioningAfterAdd()Deprecated.since 9.1 automatic versioning is now handled at versioning service level, remove versioning behaviors from importersList<DocumentLocation>findExistingDocumentWithFile(CoreSession documentManager, String path, String digest, NuxeoPrincipal principal)DocumentModelListgetCreationContainers(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.DocumentModelListgetCreationContainers(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.StringgetDigestAlgorithm()List<String>getFields()FileImportergetPluginByName(String name)VersioningOptiongetVersioningOption()Deprecated.since 9.1 automatic versioning is now handled at versioning service level, remove versioning behaviors from importersbooleanisDigestComputingEnabled()protected booleanisImporterAvailable(FileImporter importer, String normalizedMimeType, String mimeType, boolean excludeOneToMany)booleanisUnicityEnabled()voidregisterContribution(Object contribution, String xp, ComponentInstance component)protected voidregisterCreationContainerListProviders()protected voidregisterFileImporters()protected voidregisterFolderImporters()protected voidregisterUnicity()protected voidregisterVersioning()Deprecated.since 9.1voidstart(ComponentContext context)Start the component.voidunregisterContribution(Object contribution, String xp, ComponentInstance component)DocumentModelupdateDocumentFromBlob(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
applicationStarted, getApplicationStartedOrder
-
Methods inherited from interface org.nuxeo.ecm.platform.filemanager.api.FileManager
createFolder
-
-
-
-
Field Detail
-
NAME
public static final ComponentName NAME
-
DEFAULT_FOLDER_TYPE_NAME
public static final String DEFAULT_FOLDER_TYPE_NAME
- See Also:
- Constant Field Values
-
QUERY
public static final String QUERY
- See Also:
- Constant Field Values
-
MAX
public static final int MAX
- See Also:
- Constant Field Values
-
PLUGINS_EP
public static final String PLUGINS_EP
- Since:
- 11.1
- See Also:
- Constant Field Values
-
UNICITY_EP
public static final String UNICITY_EP
- Since:
- 11.1
- See Also:
- Constant Field Values
-
VERSIONING_EP
public static final String VERSIONING_EP
- Since:
- 11.1
- See Also:
- Constant Field Values
-
DEF_VERSIONING_OPTION
public static final VersioningOption DEF_VERSIONING_OPTION
-
DEF_VERSIONING_AFTER_ADD
public static final boolean DEF_VERSIONING_AFTER_ADD
- See Also:
- Constant Field Values
-
-
Method Detail
-
registerContribution
public void registerContribution(Object contribution, String xp, ComponentInstance component)
- Overrides:
registerContributionin classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String xp, ComponentInstance component)
- Overrides:
unregisterContributionin classDefaultComponent
-
start
public void start(ComponentContext context)
Description copied from interface:ComponentStart the component. This method is called after all the components were resolved and activated- Specified by:
startin interfaceComponent- Overrides:
startin classDefaultComponent
-
registerFileImporters
protected void registerFileImporters()
-
registerFolderImporters
protected void registerFolderImporters()
-
registerCreationContainerListProviders
protected void registerCreationContainerListProviders()
-
registerUnicity
protected void registerUnicity()
-
registerVersioning
@Deprecated(since="9.1") protected void registerVersioning()
Deprecated.since 9.1
-
createFolder
public DocumentModel createFolder(CoreSession documentManager, String fullname, String path, boolean overwrite) throws IOException
Description copied from interface:FileManagerCreates a Folder.- Specified by:
createFolderin interfaceFileManagerfullname- 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
@Deprecated(since="9.1") public DocumentModel defaultCreateFolder(CoreSession documentManager, String fullname, String path)
Deprecated.since 9.1, usedefaultCreateFolder(CoreSession, String, String, boolean)instead
-
defaultCreateFolder
public DocumentModel defaultCreateFolder(CoreSession documentManager, String fullname, String path, boolean overwrite)
- Since:
- 9.1
-
defaultCreateFolder
@Deprecated(since="9.1") public DocumentModel defaultCreateFolder(CoreSession documentManager, String fullname, String path, String containerTypeName, boolean checkAllowedSubTypes)
Deprecated.since 9.1, usedefaultCreateFolder(CoreSession, String, String, String, boolean, boolean)instead
-
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:FileManagerReturns an initialized doc based on a given blob.- Specified by:
createDocumentFromBlobin interfaceFileManagerinput- 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:FileManagerReturns an initialized doc based on a given blob.- Specified by:
createDocumentFromBlobin interfaceFileManagerinput- 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
public DocumentModel createOrUpdateDocument(FileImporterContext context) throws IOException
Description copied from interface:FileManagerReturns 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:
createOrUpdateDocumentin interfaceFileManager- Returns:
- the created or updated document
- Throws:
IOException- See Also:
FileImporterContext
-
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:FileManagerJust applies the same actions as creation but does not changes the doc type.- Specified by:
updateDocumentFromBlobin interfaceFileManagerinput- 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
public FileImporter getPluginByName(String name)
-
findExistingDocumentWithFile
public List<DocumentLocation> findExistingDocumentWithFile(CoreSession documentManager, String path, String digest, NuxeoPrincipal principal)
- Specified by:
findExistingDocumentWithFilein interfaceFileManager
-
isUnicityEnabled
public boolean isUnicityEnabled()
- Specified by:
isUnicityEnabledin interfaceFileManager
-
isDigestComputingEnabled
public boolean isDigestComputingEnabled()
- Specified by:
isDigestComputingEnabledin interfaceFileManager
-
getFields
public List<String> getFields()
- Specified by:
getFieldsin interfaceFileManager
-
getCreationContainers
public DocumentModelList getCreationContainers(NuxeoPrincipal principal, String docType)
Description copied from interface:FileManagerReturns 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:
getCreationContainersin interfaceFileManager- Returns:
- the list of candidate containers
-
getCreationContainers
public DocumentModelList getCreationContainers(CoreSession documentManager, String docType)
Description copied from interface:FileManagerReturns 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:
getCreationContainersin interfaceFileManager- Returns:
- the list of candidate containers
-
getDigestAlgorithm
public String getDigestAlgorithm()
- Specified by:
getDigestAlgorithmin interfaceFileManager
-
getVersioningOption
@Deprecated(since="9.1") public VersioningOption getVersioningOption()
Deprecated.since 9.1 automatic versioning is now handled at versioning service level, remove versioning behaviors from importersDescription copied from interface:FileManagerGets the versioning applied on an overwritten document before it is overwritten.- Specified by:
getVersioningOptionin interfaceFileManager
-
doVersioningAfterAdd
@Deprecated(since="9.1") public boolean doVersioningAfterAdd()
Deprecated.since 9.1 automatic versioning is now handled at versioning service level, remove versioning behaviors from importersDescription copied from interface:FileManagerChecks whether versioning should also be applied after a document is added.- Specified by:
doVersioningAfterAddin interfaceFileManager
-
-