Package org.mycore.solr.index.cs
Class MCRSolrAbstractContentStream<T>
java.lang.Object
org.apache.solr.common.util.ContentStreamBase
org.mycore.solr.index.cs.MCRSolrAbstractContentStream<T>
- All Implemented Interfaces:
AutoCloseable
,org.apache.solr.common.util.ContentStream
- Direct Known Subclasses:
MCRSolrPathContentStream
public abstract class MCRSolrAbstractContentStream<T>
extends org.apache.solr.common.util.ContentStreamBase
implements AutoCloseable
Wraps objects to be sent to solr in a content stream.
- Author:
- shermann, Matthias Eichner
- See Also:
-
ContentStream
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.solr.common.util.ContentStreamBase
org.apache.solr.common.util.ContentStreamBase.ByteArrayStream, org.apache.solr.common.util.ContentStreamBase.FileStream, org.apache.solr.common.util.ContentStreamBase.StringStream, org.apache.solr.common.util.ContentStreamBase.URLStream
-
Field Summary
Fields inherited from class org.apache.solr.common.util.ContentStreamBase
contentType, DEFAULT_CHARSET, name, size, sourceInfo
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected Charset
Required forgetReader()
to transform any InputStream into a Reader.getSize()
boolean
isSetup()
Checks if the content stream is already set up and ready to use.void
setInputStream
(InputStream inputStream) protected abstract void
setup()
Sets certain properties on a contentStream object.Methods inherited from class org.apache.solr.common.util.ContentStreamBase
attemptToDetermineContentType, create, getCharsetFromContentType, getContentType, getName, getSourceInfo, setContentType, setName, setSize, setSourceInfo
-
Field Details
-
setup
protected boolean setup -
streamReader
-
source
-
-
Constructor Details
-
MCRSolrAbstractContentStream
public MCRSolrAbstractContentStream() -
MCRSolrAbstractContentStream
-
-
Method Details
-
getStream
- Specified by:
getStream
in interfaceorg.apache.solr.common.util.ContentStream
- Throws:
IOException
-
setInputStream
-
setup
Sets certain properties on a contentStream object. Subclasses must override this method.Its important to call the following setter methods:
- setName
- setSize
- setSourceInfo
- setContentType
- setInputStream
- Throws:
IOException
-
getCharset
Required forgetReader()
to transform any InputStream into a Reader.- Returns:
- null, will default to "UTF-8"
-
isSetup
public boolean isSetup()Checks if the content stream is already set up and ready to use.- Returns:
- true if set up.
-
getReader
- Specified by:
getReader
in interfaceorg.apache.solr.common.util.ContentStream
- Overrides:
getReader
in classorg.apache.solr.common.util.ContentStreamBase
- Throws:
IOException
-
getSize
- Specified by:
getSize
in interfaceorg.apache.solr.common.util.ContentStream
- Overrides:
getSize
in classorg.apache.solr.common.util.ContentStreamBase
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
getSource
-