public class RequestWriter.LazyContentStream extends java.lang.Object implements ContentStream
Modifier and Type | Field and Description |
---|---|
(package private) ContentStream |
contentStream |
(package private) UpdateRequest |
req |
Constructor and Description |
---|
LazyContentStream(UpdateRequest req) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getContentType() |
private ContentStream |
getDelegate() |
java.lang.String |
getName() |
java.io.Reader |
getReader()
Get an open stream.
|
java.lang.Long |
getSize() |
java.lang.String |
getSourceInfo() |
java.io.InputStream |
getStream()
Get an open stream.
|
void |
writeTo(java.io.OutputStream os) |
ContentStream contentStream
UpdateRequest req
public LazyContentStream(UpdateRequest req)
private ContentStream getDelegate()
public java.lang.String getName()
getName
in interface ContentStream
public java.lang.String getSourceInfo()
getSourceInfo
in interface ContentStream
public java.lang.String getContentType()
getContentType
in interface ContentStream
public java.lang.Long getSize()
getSize
in interface ContentStream
null
if not knownpublic java.io.InputStream getStream() throws java.io.IOException
ContentStream
InputStream stream = stream.getStream(); try { // use the stream... } finally { IOUtils.closeQuietly(stream); }Only the first call to
getStream()
or getReader()
is guaranteed to work. The runtime behavior for additional calls is undefined.
Note: you must call getStream()
or getReader()
before
the attributes (name, contentType, etc) are guaranteed to be set. Streams may be
lazy loaded only when this method is called.getStream
in interface ContentStream
java.io.IOException
public java.io.Reader getReader() throws java.io.IOException
ContentStream
Reader reader = stream.getReader(); try { // use the reader... } finally { IOUtils.closeQuietly(reader); }Only the first call to
getStream()
or getReader()
is guaranteed to work. The runtime behavior for additional calls is undefined.
Note: you must call getStream()
or getReader()
before
the attributes (name, contentType, etc) are guaranteed to be set. Streams may be
lazy loaded only when this method is called.getReader
in interface ContentStream
java.io.IOException
public void writeTo(java.io.OutputStream os) throws java.io.IOException
java.io.IOException