Nuxeo ECM Projects 5.4.3-SNAPSHOT

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 String DEFAULT_FOLDER_TYPE_NAME
           
static int MAX
           
static ComponentName NAME
           
static String QUERY
           
 
Constructor Summary
FileManagerService()
           
 
Method Summary
 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)
           
 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)
           
 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.
 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, applicationStarted, 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 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
Constructor Detail

FileManagerService

public FileManagerService()
Method Detail

createFolder

public DocumentModel createFolder(CoreSession documentManager,
                                  String fullname,
                                  String path)
                           throws ClientException,
                                  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
IOException

defaultCreateFolder

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

defaultCreateFolder

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

createDocumentFromBlob

public DocumentModel createDocumentFromBlob(CoreSession documentManager,
                                            Blob input,
                                            String path,
                                            boolean overwrite,
                                            String fullName)
                                     throws 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:
IOException
ClientException

updateDocumentFromBlob

public DocumentModel updateDocumentFromBlob(CoreSession documentManager,
                                            Blob input,
                                            String path,
                                            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(String name)

registerExtension

public void registerExtension(Extension extension)
                       throws 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:
Exception - if any error occurs

unregisterExtension

public void unregisterExtension(Extension extension)
                         throws 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:
Exception - if any error occurs

computeDigest

public String computeDigest(Blob blob)
                     throws NoSuchAlgorithmException,
                            IOException
Specified by:
computeDigest in interface FileManager
Throws:
NoSuchAlgorithmException
IOException

findExistingDocumentWithFile

public List<DocumentLocation> findExistingDocumentWithFile(CoreSession documentManager,
                                                           String path,
                                                           String digest,
                                                           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 List<String> getFields()
Specified by:
getFields in interface FileManager

getCreationContainers

public DocumentModelList getCreationContainers(Principal principal,
                                               String docType)
                                        throws 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:
Exception

getCreationContainers

public DocumentModelList getCreationContainers(CoreSession documentManager,
                                               String docType)
                                        throws 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:
Exception

getDigestAlgorithm

public String getDigestAlgorithm()
Specified by:
getDigestAlgorithm in interface FileManager

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.