Nuxeo Enterprise Platform 5.4

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 java.lang.Object


Method Summary
static java.lang.String fetchFileName(java.io.File file)
          Returns the fileName of a file.
static java.lang.String fetchFileName(java.lang.String fullName)
          Returns the fileName of an uploaded file.
static java.lang.String fetchTitle(java.lang.String filename)
          Returns the title.
static byte[] getBytesFromFile(java.io.File file)
          Returns the contents of the file in a byte array.
static DocumentModel getExistingDocByFileName(CoreSession documentManager, java.lang.String path, java.lang.String filename)
          Looks if an existing Document with the same filename exists.
static DocumentModel getExistingDocByTitle(CoreSession documentManager, java.lang.String path, java.lang.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(java.io.File file)
                               throws java.io.IOException
Returns the contents of the file in a byte array.

Parameters:
file -
Returns:
the byte array
Throws:
java.io.IOException

fetchFileName

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

Parameters:
file -
Returns:
the FileName String
Throws:
java.net.MalformedURLException

fetchFileName

public static java.lang.String fetchFileName(java.lang.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 java.lang.String fetchTitle(java.lang.String filename)
Returns the title.

Parameters:
filename - the file name
Returns:
the title

getExistingDocByFileName

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

Throws:
ClientException

getExistingDocByTitle

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

Throws:
ClientException

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.