org.apache.solr.util
Interface ContentStream

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

public interface ContentStream

Since:
solr 1.2
Version:
$Id$
Author:
ryan

Method Summary
 java.lang.String getContentType()
           
 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.
 

Method Detail

getName

java.lang.String getName()

getSourceInfo

java.lang.String getSourceInfo()

getContentType

java.lang.String getContentType()

getSize

java.lang.Long getSize()
Returns:
the stream size or null if not known

getStream

java.io.InputStream getStream()
                              throws java.io.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(reader);
   }
  
Only the first call to getStream() or getReader() is gaurenteed to work. The runtime behavior for aditional calls is undefined.

Throws:
java.io.IOException

getReader

java.io.Reader getReader()
                         throws java.io.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 gaurenteed to work. The runtime behavior for aditional calls is undefined.

Throws:
java.io.IOException


Copyright © 2006 - 2008 The Apache Software Foundation