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 ContentStreampublic java.lang.String getSourceInfo()
getSourceInfo in interface ContentStreampublic java.lang.String getContentType()
getContentType in interface ContentStreampublic java.lang.Long getSize()
getSize in interface ContentStreamnull 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 ContentStreamjava.io.IOExceptionpublic 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 ContentStreamjava.io.IOExceptionpublic void writeTo(java.io.OutputStream os)
throws java.io.IOException
java.io.IOException