Package org.apache.solr.common.util
Class ContentStreamBase
- java.lang.Object
- 
- org.apache.solr.common.util.ContentStreamBase
 
- 
- All Implemented Interfaces:
- ContentStream
 - Direct Known Subclasses:
- ContentStreamBase.ByteArrayStream,- ContentStreamBase.FileStream,- ContentStreamBase.StringStream,- ContentStreamBase.URLStream
 
 public abstract class ContentStreamBase extends Object implements ContentStream Three concrete implementations for ContentStream - one for File/URL/String- Since:
- solr 1.2
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classContentStreamBase.ByteArrayStreamConstruct aContentStreamfrom aFilestatic classContentStreamBase.FileStreamConstruct aContentStreamfrom aFilestatic classContentStreamBase.StringStreamConstruct aContentStreamfrom aStringstatic classContentStreamBase.URLStreamConstruct aContentStreamfrom aURLThis uses aURLConnectionto get the content stream
 - 
Field SummaryFields Modifier and Type Field Description static StringAPPLICATION_GZIPstatic StringAPPLICATION_JSONstatic StringAPPLICATION_OCTET_STREAMstatic StringAPPLICATION_XMLprotected StringcontentTypestatic StringDEFAULT_CHARSETprotected Stringnameprotected Longsizeprotected StringsourceInfostatic StringTEXT_XML
 - 
Constructor SummaryConstructors Constructor Description ContentStreamBase()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringattemptToDetermineContentType()static ContentStreamcreate(RequestWriter requestWriter, SolrRequest req)static StringgetCharsetFromContentType(String contentType)StringgetContentType()StringgetName()ReadergetReader()Base reader implementation.LonggetSize()StringgetSourceInfo()voidsetContentType(String contentType)voidsetName(String name)voidsetSize(Long size)voidsetSourceInfo(String sourceInfo)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.solr.common.util.ContentStreamgetStream
 
- 
 
- 
- 
- 
Field Detail- 
DEFAULT_CHARSETpublic static final String DEFAULT_CHARSET 
 - 
TEXT_XMLpublic static final String TEXT_XML - See Also:
- Constant Field Values
 
 - 
APPLICATION_OCTET_STREAMpublic static final String APPLICATION_OCTET_STREAM - See Also:
- Constant Field Values
 
 - 
APPLICATION_GZIPpublic static final String APPLICATION_GZIP - See Also:
- Constant Field Values
 
 - 
APPLICATION_XMLpublic static final String APPLICATION_XML - See Also:
- Constant Field Values
 
 - 
APPLICATION_JSONpublic static final String APPLICATION_JSON - See Also:
- Constant Field Values
 
 - 
nameprotected String name 
 - 
sourceInfoprotected String sourceInfo 
 - 
contentTypeprotected String contentType 
 - 
sizeprotected Long size 
 
- 
 - 
Method Detail- 
attemptToDetermineContentTypeprotected String attemptToDetermineContentType() 
 - 
getReaderpublic Reader getReader() throws IOException Base reader implementation. If the contentType declares a charset use it, otherwise use "utf-8".- Specified by:
- getReaderin interface- ContentStream
- Throws:
- IOException
 
 - 
getContentTypepublic String getContentType() - Specified by:
- getContentTypein interface- ContentStream
 
 - 
setContentTypepublic void setContentType(String contentType) 
 - 
getNamepublic String getName() - Specified by:
- getNamein interface- ContentStream
 
 - 
setNamepublic void setName(String name) 
 - 
getSizepublic Long getSize() - Specified by:
- getSizein interface- ContentStream
- Returns:
- the stream size or nullif not known
 
 - 
setSizepublic void setSize(Long size) 
 - 
getSourceInfopublic String getSourceInfo() - Specified by:
- getSourceInfoin interface- ContentStream
 
 - 
setSourceInfopublic void setSourceInfo(String sourceInfo) 
 - 
createpublic static ContentStream create(RequestWriter requestWriter, SolrRequest req) throws IOException - Throws:
- IOException
 
 
- 
 
-