org.d2rq.download
Class DownloadContentQuery
java.lang.Object
org.d2rq.download.DownloadContentQuery
public class DownloadContentQuery
- extends Object
A helper that evaluates a DownloadRelation
for a particular
URI, returning either the content, or null if the
URI isn't applicable for the download map or there is nothing
in the table for the value.
This directly runs its own SQL query because the handling of
BLOBs here requires returning an InputStream, and that's not
easily supported by our usual SQL query class.
- Author:
- RichardCyganiak
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DownloadContentQuery
public DownloadContentQuery(DownloadRelation downloadRelation,
String uri)
- Parameters:
downloadRelation
- The download map to be querieduri
- The URI whose content is desired
hasContent
public boolean hasContent()
getContentStream
public InputStream getContentStream()
- A stream over the downloadable content. Undefined if
hasContent()
is false
.
getMediaType
public String getMediaType()
- The media type of the downloadable content. Undefined if
hasContent()
is false
.
close
public void close()