org.nuxeo.ecm.core.api.impl.blob
Class FileBlob
java.lang.Object
org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
org.nuxeo.ecm.core.api.impl.blob.StreamBlob
org.nuxeo.ecm.core.api.impl.blob.DefaultStreamBlob
org.nuxeo.ecm.core.api.impl.blob.FileBlob
- All Implemented Interfaces:
- java.io.Serializable, Blob
public class FileBlob
- extends DefaultStreamBlob
- implements java.io.Serializable
- Author:
- Bogdan Stefanescu
- See Also:
- Serialized Form
Constructor Summary |
FileBlob(java.io.File file)
|
FileBlob(java.io.File file,
java.lang.String ctype)
|
FileBlob(java.io.File file,
java.lang.String mimeType,
java.lang.String encoding)
|
FileBlob(java.io.File file,
java.lang.String mimeType,
java.lang.String encoding,
java.lang.String filename,
java.lang.String digest)
|
FileBlob(java.io.InputStream in)
|
FileBlob(java.io.InputStream in,
java.lang.String ctype)
|
FileBlob(java.io.InputStream in,
java.lang.String mimeType,
java.lang.String encoding)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileBlob
public FileBlob(java.io.File file)
FileBlob
public FileBlob(java.io.File file,
java.lang.String ctype)
FileBlob
public FileBlob(java.io.File file,
java.lang.String mimeType,
java.lang.String encoding)
FileBlob
public FileBlob(java.io.File file,
java.lang.String mimeType,
java.lang.String encoding,
java.lang.String filename,
java.lang.String digest)
FileBlob
public FileBlob(java.io.InputStream in)
throws java.io.IOException
- Throws:
java.io.IOException
FileBlob
public FileBlob(java.io.InputStream in,
java.lang.String ctype)
throws java.io.IOException
- Throws:
java.io.IOException
FileBlob
public FileBlob(java.io.InputStream in,
java.lang.String mimeType,
java.lang.String encoding)
throws java.io.IOException
- Throws:
java.io.IOException
getFile
public java.io.File getFile()
getLength
public long getLength()
- Description copied from interface:
Blob
- Gets the data length in bytes if known.
- Specified by:
getLength
in interface Blob
- Overrides:
getLength
in class StreamBlob
- Returns:
- the data length or -1 if not known
getStream
public java.io.InputStream getStream()
throws java.io.IOException
- Specified by:
getStream
in interface Blob
- Throws:
java.io.IOException
persist
public Blob persist()
- Description copied from interface:
Blob
- Persist this stream so that
Blob.getStream()
method can be called
successfully several times. The persistence is done in a temporary file
or in memory - this is up to the implementation.
Blobs that are already persistent return themselves.
Persistence should update the internal structure of the Blob to make it
persistent whenever possible and hence return itself whenever possible.
This behavior cannot be guaranteed by every implementation however.
- Specified by:
persist
in interface Blob
- Returns:
- a persistent version of the blob
isPersistent
public boolean isPersistent()
- Description copied from interface:
Blob
- Checks whether this blob is persistent. (i.e. if
Blob.getStream()
can be
successfully called several times).
- Specified by:
isPersistent
in interface Blob
- Returns:
- true if persistent, false otherwise
Copyright © 2010 Nuxeo SAS. All Rights Reserved.