Package org.nuxeo.ecm.core.api.impl.blob
Class URLBlob
- java.lang.Object
-
- org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
-
- org.nuxeo.ecm.core.api.impl.blob.URLBlob
-
- All Implemented Interfaces:
Serializable,Blob
public class URLBlob extends AbstractBlob implements Serializable
Blob backed by a URL. Its length is -1. Note that the encoding is not detected even for an HTTP URL.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected URLurl-
Fields inherited from class org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
digest, digestAlgorithm, encoding, filename, mimeType, TEXT_PLAIN, UTF_8
-
-
Constructor Summary
Constructors Constructor Description URLBlob(URL url)URLBlob(URL url, String mimeType)URLBlob(URL url, String mimeType, String encoding)URLBlob(URL url, String mimeType, String encoding, String filename)Deprecated.since 7.2, use a separateAbstractBlob.setFilename(java.lang.String)call
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamgetStream()Gets anInputStreamfor the data of this blob.-
Methods inherited from class org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
equals, equalsStream, getByteArray, getCloseableFile, getCloseableFile, getDigest, getDigestAlgorithm, getEncoding, getFile, getFilename, getLength, getMimeType, getString, hashCode, setDigest, setDigestAlgorithm, setEncoding, setFilename, setMimeType, transferTo, transferTo
-
-
-
-
Field Detail
-
url
protected final URL url
-
-
Constructor Detail
-
URLBlob
public URLBlob(URL url)
-
URLBlob
@Deprecated public URLBlob(URL url, String mimeType, String encoding, String filename)
Deprecated.since 7.2, use a separateAbstractBlob.setFilename(java.lang.String)call
-
-
Method Detail
-
getStream
public InputStream getStream() throws IOException
Description copied from interface:BlobGets anInputStreamfor the data of this blob.The contract of
Blobis that this method can be called several times and will correctly return a newInputStreameach time. In other words, several reads of theBlobcan be done.Like all
InputStream, the result must be closed when done with it to avoid resource leaks.- Specified by:
getStreamin interfaceBlob- Returns:
- the stream
- Throws:
IOException
-
-