Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.filemanager.service
Class FileManagerService

java.lang.Object
  extended by org.nuxeo.runtime.model.DefaultComponent
      extended by org.nuxeo.ecm.platform.filemanager.service.FileManagerService
All Implemented Interfaces:
FileManager, Adaptable, Component, Extensible

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
static java.lang.String DEFAULT_FOLDER_TYPE_NAME
           
static int MAX
           
static ComponentName NAME
           
static java.lang.String QUERY
           
 
Constructor Summary
FileManagerService()
           
 
Method Summary
 java.lang.String computeDigest(Blob blob)
           
 DocumentModel createDocumentFromBlob(CoreSession documentManager, Blob input, java.lang.String path, boolean overwrite, java.lang.String fullName)
          Returns an initialized doc based on a given blob.
 DocumentModel createFolder(CoreSession documentManager, java.lang.String fullname, java.lang.String path)
          Creates a Folder.
 DocumentModel defaultCreateFolder(CoreSession documentManager, java.lang.String fullname, java.lang.String path)
           
 DocumentModel defaultCreateFolder(CoreSession documentManager, java.lang.String fullname, java.lang.String path, java.lang.String containerTypeName, boolean checkAllowedSubTypes)
           
 java.util.List<DocumentLocation> findExistingDocumentWithFile(CoreSession documentManager, java.lang.String path, java.lang.String digest, java.security.Principal principal)
           
 DocumentModelList getCreationContainers(CoreSession documentManager, java.lang.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(java.security.Principal principal, java.lang.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.
 java.lang.String getDigestAlgorithm()
           
 java.util.List<java.lang.String> getFields()
           
 FileImporter getPluginByName(java.lang.String name)
           
 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, java.lang.String path, java.lang.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, deactivate, getAdapter, registerContribution, unregisterContribution
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final ComponentName NAME

DEFAULT_FOLDER_TYPE_NAME

public static final java.lang.String DEFAULT_FOLDER_TYPE_NAME
See Also:
Constant Field Values

QUERY

public static final java.lang.String QUERY
See Also:
Constant Field Values

MAX

public static final int MAX
See Also:
Constant Field Values
Constructor Detail

FileManagerService

public FileManagerService()
Method Detail

createFolder

public DocumentModel createFolder(CoreSession documentManager,
                                  java.lang.String fullname,
                                  java.lang.String path)
                           throws ClientException,
                                  java.io.IOException
Description copied from interface: FileManager
Creates a Folder.

Specified by:
createFolder in interface FileManager
fullname - the full name of the folder
path - the path were to create the folder
Returns:
the Folder Created
Throws:
ClientException
java.io.IOException

defaultCreateFolder

public DocumentModel defaultCreateFolder(CoreSession documentManager,
                                         java.lang.String fullname,
                                         java.lang.String path)
                                  throws ClientException
Throws:
ClientException

defaultCreateFolder

public DocumentModel defaultCreateFolder(CoreSession documentManager,
                                         java.lang.String fullname,
                                         java.lang.String path,
                                         java.lang.String containerTypeName,
                                         boolean checkAllowedSubTypes)
                                  throws ClientException
Throws:
ClientException

createDocumentFromBlob

public DocumentModel createDocumentFromBlob(CoreSession documentManager,
                                            Blob input,
                                            java.lang.String path,
                                            boolean overwrite,
                                            java.lang.String fullName)
                                     throws java.io.IOException,
                                            ClientException
Description copied from interface: FileManager
Returns an initialized doc based on a given blob.

Specified by:
createDocumentFromBlob in interface FileManager
input - the blob containing the content and the mime type
path - the path were to create the document
overwrite - boolean how decide to overwrite or not
fullName - the fullname that contains the filename
Returns:
the created Document
Throws:
java.io.IOException
ClientException

updateDocumentFromBlob

public DocumentModel updateDocumentFromBlob(CoreSession documentManager,
                                            Blob input,
                                            java.lang.String path,
                                            java.lang.String fullName)
                                     throws ClientException
Description copied from interface: FileManager
Just applies the same actions as creation but does not changes the doc type.

Specified by:
updateDocumentFromBlob in interface FileManager
input - the blob containing the content and the mime type
path - the path to the file to update
fullName - the full name that contains the filename
Returns:
the updated Document
Throws:
ClientException

getPluginByName

public FileImporter getPluginByName(java.lang.String name)

registerExtension

public void registerExtension(Extension extension)
                       throws java.lang.Exception
Description copied from interface: Extensible
Registers the given extension.

Specified by:
registerExtension in interface Extensible
Overrides:
registerExtension in class DefaultComponent
Parameters:
extension - the extension to register
Throws:
java.lang.Exception - if any error occurs

unregisterExtension

public void unregisterExtension(Extension extension)
                         throws java.lang.Exception
Description copied from interface: Extensible
Unregisters the given extension.

Specified by:
unregisterExtension in interface Extensible
Overrides:
unregisterExtension in class DefaultComponent
Parameters:
extension - the extension to unregister
Throws:
java.lang.Exception - if any error occurs

computeDigest

public java.lang.String computeDigest(Blob blob)
                               throws java.security.NoSuchAlgorithmException,
                                      java.io.IOException
Specified by:
computeDigest in interface FileManager
Throws:
java.security.NoSuchAlgorithmException
java.io.IOException

findExistingDocumentWithFile

public java.util.List<DocumentLocation> findExistingDocumentWithFile(CoreSession documentManager,
                                                                     java.lang.String path,
                                                                     java.lang.String digest,
                                                                     java.security.Principal principal)
                                                              throws ClientException
Specified by:
findExistingDocumentWithFile in interface FileManager
Throws:
ClientException

isUnicityEnabled

public boolean isUnicityEnabled()
Specified by:
isUnicityEnabled in interface FileManager

isDigestComputingEnabled

public boolean isDigestComputingEnabled()
Specified by:
isDigestComputingEnabled in interface FileManager

getFields

public java.util.List<java.lang.String> getFields()
Specified by:
getFields in interface FileManager

getCreationContainers

public DocumentModelList getCreationContainers(java.security.Principal principal,
                                               java.lang.String docType)
                                        throws java.lang.Exception
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 interface FileManager
Returns:
the list of candidate containers
Throws:
java.lang.Exception

getCreationContainers

public DocumentModelList getCreationContainers(CoreSession documentManager,
                                               java.lang.String docType)
                                        throws java.lang.Exception
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 interface FileManager
Returns:
the list of candidate containers
Throws:
java.lang.Exception

getDigestAlgorithm

public java.lang.String getDigestAlgorithm()
Specified by:
getDigestAlgorithm in interface FileManager

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.