org.apache.solr.client.solrj.request
public class RequestWriter.LazyContentStream extends Object implements ContentStream
Constructor and Description |
---|
RequestWriter.LazyContentStream(UpdateRequest req) |
Modifier and Type | Method and Description |
---|---|
String |
getContentType() |
String |
getName() |
Reader |
getReader()
Get an open stream.
|
Long |
getSize() |
String |
getSourceInfo() |
InputStream |
getStream()
Get an open stream.
|
void |
writeTo(OutputStream os) |
public RequestWriter.LazyContentStream(UpdateRequest req)
public String getName()
getName
in interface ContentStream
public String getSourceInfo()
getSourceInfo
in interface ContentStream
public String getContentType()
getContentType
in interface ContentStream
public Long getSize()
getSize
in interface ContentStream
null
if not knownpublic InputStream getStream() throws 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
IOException
public Reader getReader() throws 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
IOException
public void writeTo(OutputStream os) throws IOException
IOException
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.