Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.api.impl.blob
Class InputStreamBlob

java.lang.Object
  extended by org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
      extended by org.nuxeo.ecm.core.api.impl.blob.StreamBlob
          extended by org.nuxeo.ecm.core.api.impl.blob.DefaultStreamBlob
              extended by org.nuxeo.ecm.core.api.impl.blob.InputStreamBlob
All Implemented Interfaces:
Serializable, Blob

public class InputStreamBlob
extends DefaultStreamBlob

Author:
Bogdan Stefanescu
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
EMPTY_BYTE_ARRAY, EMPTY_INPUT_STREAM, EMPTY_READER, EMPTY_STRING
 
Constructor Summary
InputStreamBlob(InputStream in)
           
InputStreamBlob(InputStream in, String ctype)
           
InputStreamBlob(InputStream in, String ctype, String encoding)
           
InputStreamBlob(InputStream in, String ctype, String encoding, String filename, String digest)
           
 
Method Summary
 InputStream getStream()
           
 boolean isPersistent()
          Checks whether this blob is persistent.
 Blob persist()
          Persist this stream so that Blob.getStream() method can be called successfully several times.
 
Methods inherited from class org.nuxeo.ecm.core.api.impl.blob.DefaultStreamBlob
getDigest, getEncoding, getFilename, getMimeType, setDigest, setEncoding, setFilename, setMimeType
 
Methods inherited from class org.nuxeo.ecm.core.api.impl.blob.StreamBlob
asByteArrayBlob, asStringBlob, getByteArray, getLength, getReader, getString, readBytes, readBytes, readString
 
Methods inherited from class org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
copy, copy, transferTo, transferTo, transferTo
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputStreamBlob

public InputStreamBlob(InputStream in)

InputStreamBlob

public InputStreamBlob(InputStream in,
                       String ctype)

InputStreamBlob

public InputStreamBlob(InputStream in,
                       String ctype,
                       String encoding)

InputStreamBlob

public InputStreamBlob(InputStream in,
                       String ctype,
                       String encoding,
                       String filename,
                       String digest)
Method Detail

getStream

public InputStream getStream()

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).

Returns:
true if persistent, false otherwise

persist

public Blob persist()
             throws IOException
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.

Returns:
a persistent version of the blob
Throws:
IOException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.