Nuxeo ECM Projects 5.4.3-SNAPSHOT

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 Object


Method Summary
static Blob createSerializableBlob(InputStream file, String filename, String mimeType)
          Creates a serializable blob from a stream, with filename and mimetype detection.
static String getCleanFileName(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(InputStream file,
                                          String filename,
                                          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 String getCleanFileName(String filename)
Returns a clean filename, stripping upload path on client side.

Fixes NXP-544


Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.