org.apache.solr.util
Class ContentStreamBase
java.lang.Object
org.apache.solr.util.ContentStreamBase
- All Implemented Interfaces:
- ContentStream
- Direct Known Subclasses:
- ContentStreamBase.FileStream, ContentStreamBase.StringStream, ContentStreamBase.URLStream
public abstract class ContentStreamBase
- extends java.lang.Object
- implements ContentStream
Three concrete implementations for ContentStream - one for File/URL/String
- Since:
- solr 1.2
- Version:
- $Id$
- Author:
- ryan
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_CHARSET
public static final java.lang.String DEFAULT_CHARSET
- See Also:
- Constant Field Values
name
protected java.lang.String name
sourceInfo
protected java.lang.String sourceInfo
contentType
protected java.lang.String contentType
size
protected java.lang.Long size
ContentStreamBase
public ContentStreamBase()
getCharsetFromContentType
public static java.lang.String getCharsetFromContentType(java.lang.String contentType)
getReader
public java.io.Reader getReader()
throws java.io.IOException
- Base reader implementation. If the contentType declares a
charset use it, otherwise use "utf-8".
- Specified by:
getReader
in interface ContentStream
- Throws:
java.io.IOException
getContentType
public java.lang.String getContentType()
- Specified by:
getContentType
in interface ContentStream
setContentType
public void setContentType(java.lang.String contentType)
getName
public java.lang.String getName()
- Specified by:
getName
in interface ContentStream
setName
public void setName(java.lang.String name)
getSize
public java.lang.Long getSize()
- Specified by:
getSize
in interface ContentStream
- Returns:
- the stream size or
null
if not known
setSize
public void setSize(java.lang.Long size)
getSourceInfo
public java.lang.String getSourceInfo()
- Specified by:
getSourceInfo
in interface ContentStream
setSourceInfo
public void setSourceInfo(java.lang.String sourceInfo)
Copyright © 2006 - 2009 The Apache Software Foundation