public final class ResourceURIDownloader extends java.lang.Object implements URIDownloader
resource URI scheme
Here, resource is to be interpreted as a Java resource, exactly
what you would obtain using Class.getResourceAsStream(String).
And in fact, this is what this downloader does: it takes whatever is in
the provided URI's path (using URI.getPath()) and tries to make an
input stream of it. The difference is that an IOException will be
thrown if the resource cannot be found (instead of returning null).
| Modifier and Type | Method and Description |
|---|---|
java.io.InputStream |
fetch(java.net.URI source)
Fetch the content at a given URI
|
static URIDownloader |
getInstance() |
public static URIDownloader getInstance()
public java.io.InputStream fetch(java.net.URI source)
throws java.io.IOException
URIDownloaderfetch in interface URIDownloadersource - the URIInputStreamjava.io.IOException - unable to find an input stream