Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.filemanager.utils
Class FileManagerUtils

java.lang.Object
  extended by org.nuxeo.ecm.platform.filemanager.utils.FileManagerUtils

public final class FileManagerUtils
extends Object


Method Summary
static String fetchFileName(File file)
          Returns the fileName of a file.
static String fetchFileName(String fullName)
          Returns the fileName of an uploaded file.
static String fetchTitle(String filename)
          Returns the title.
static byte[] getBytesFromFile(File file)
          Returns the contents of the file in a byte array.
static DocumentModel getExistingDocByFileName(CoreSession documentManager, String path, String filename)
          Looks if an existing Document with the same filename exists.
static DocumentModel getExistingDocByPropertyName(CoreSession documentManager, String path, String value, String propertyName)
          Looks if an existing Document has the same value for a given property.
static DocumentModel getExistingDocByTitle(CoreSession documentManager, String path, String title)
          Looks if an existing Document with the same title exists.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getBytesFromFile

public static byte[] getBytesFromFile(File file)
                               throws IOException
Returns the contents of the file in a byte array.

Throws:
IOException

fetchFileName

public static String fetchFileName(File file)
                            throws MalformedURLException
Returns the fileName of a file.

Throws:
MalformedURLException

fetchFileName

public static String fetchFileName(String fullName)
Returns the fileName of an uploaded file.

Parameters:
fullName - the full name that we need to parse
Returns:
the FileName String

fetchTitle

public static String fetchTitle(String filename)
Returns the title.

Parameters:
filename - the file name
Returns:
the title

getExistingDocByFileName

public static DocumentModel getExistingDocByFileName(CoreSession documentManager,
                                                     String path,
                                                     String filename)
                                              throws ClientException
Looks if an existing Document with the same filename exists.

Throws:
ClientException

getExistingDocByTitle

public static DocumentModel getExistingDocByTitle(CoreSession documentManager,
                                                  String path,
                                                  String title)
                                           throws ClientException
Looks if an existing Document with the same title exists.

Throws:
ClientException

getExistingDocByPropertyName

public static DocumentModel getExistingDocByPropertyName(CoreSession documentManager,
                                                         String path,
                                                         String value,
                                                         String propertyName)
                                                  throws ClientException
Looks if an existing Document has the same value for a given property.

Throws:
ClientException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.