org.apache.solr.common.util
public interface ContentStream
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.
|
String getName()
String getSourceInfo()
String getContentType()
Long getSize()
null
if not knownInputStream getStream() throws IOException
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.IOException
Reader getReader() throws IOException
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.IOException
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.