public class FileUtils extends Object
Modifier and Type | Method and Description |
---|---|
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.
|
public static Blob createSerializableBlob(InputStream file, String filename, String mimeType)
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.
file
- the input stream holding datafilename
- 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.Copyright © 2011 Nuxeo SA. All Rights Reserved.