ContentStream (Solr 3.6.2 API)
Keywords: org.apache.solr.common.util.ContentStream interface

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.solr.common.util
Interface ContentStream

All Known Subinterfaces:
  ContentStream

All Known Implementing Classes:
  ContentStreamBase, ContentStreamBase, ContentStreamBase.FileStream, ContentStreamBase.StringStream, ContentStreamBase.URLStream, RequestWriter.LazyContentStream

    public interface ContentStream

Since:
  solr 1.2
Version:
  $Id$

Method Summary
`String` | `getContentType()`
`String` | `getName()`
`Reader` | `getReader()` Get an open stream.
`Long` | `getSize()`
`String` | `getSourceInfo()`
`InputStream` | `getStream()` Get an open stream.

Method Detail

### getName

    String getName()

### getSourceInfo

    String getSourceInfo()

### getContentType

    String getContentType()

### getSize

    Long getSize()

  Returns:
    the stream size or `null` if not known

### getStream

    InputStream getStream()
                          throws IOException

  Get an open stream. You are responsible for closing it. Consider using something like:

         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.

  Throws:
    `IOException`

### getReader

    Reader getReader()
                     throws IOException

  Get an open stream. You are responsible for closing it. Consider using something like:

         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.

  Throws:
    `IOException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD