Package org.apache.any23.source
Interface DocumentSource
-
- All Known Implementing Classes:
ByteArrayDocumentSource
,FileDocumentSource
,HTTPDocumentSource
,StringDocumentSource
public interface DocumentSource
A source of input streams. Mostly intended for situations where opening of an input stream is to be delayed.- Author:
- Richard Cyganiak (richard@cyganiak.de)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getContentLength()
String
getContentType()
String
getDocumentIRI()
boolean
isLocal()
A value of false indicates that the document resides remotely, and that multiple successive accesses to it should be avoided by copying it to local storage.InputStream
openInputStream()
Returns the input stream for accessing the content of the document.
-
-
-
Method Detail
-
openInputStream
InputStream openInputStream() throws IOException
Returns the input stream for accessing the content of the document.- Returns:
- not
null
input stream for accessing document data. - Throws:
IOException
- if there is an error opening theDocumentSource
InputStream
-
getContentType
String getContentType()
- Returns:
- a string describing the content type of the provided document.
-
getContentLength
long getContentLength()
- Returns:
- the size of the content length in bytes.
-
getDocumentIRI
String getDocumentIRI()
- Returns:
- the actual, final, canonical IRI if redirects occur.
-
isLocal
boolean isLocal()
A value of false indicates that the document resides remotely, and that multiple successive accesses to it should be avoided by copying it to local storage. This can also be used for sources that do not support multiple calls toopenInputStream()
.- Returns:
- true if the
DocumentSource
is cached locally.
-
-