Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.ui.web.util.files
Class FileUtils

java.lang.Object
  extended by org.nuxeo.ecm.platform.ui.web.util.files.FileUtils

public class FileUtils
extends java.lang.Object


Method Summary
static Blob createSerializableBlob(java.io.InputStream file, java.lang.String filename, java.lang.String mimeType)
          Creates a serializable blob from a stream, with filename and mimetype detection.
static java.lang.String getCleanFileName(java.lang.String filename)
          Returns a clean filename, stripping upload path on client side.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createSerializableBlob

public static Blob createSerializableBlob(java.io.InputStream file,
                                          java.lang.String filename,
                                          java.lang.String mimeType)
Creates a serializable blob from a stream, with filename and mimetype detection.

Creates an in-memory blob if data is under 64K, otherwise constructs a serializable FileBlob which stores data in a temporary file on the hard disk.

Parameters:
file - the input stream holding data
filename - the file name. Will be set on the blob and will used for mimetype detection.
mimeType - the detected mimetype at upload. Can be null. Will be verified by the mimetype service.

getCleanFileName

public static java.lang.String getCleanFileName(java.lang.String filename)
Returns a clean filename, stripping upload path on client side.

Fixes NXP-544


Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.