public final class ResourceURIDownloader extends Object implements URIDownloader
resource
"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
).
public static URIDownloader getInstance()
public InputStream fetch(URI source) throws IOException
URIDownloader
fetch
in interface URIDownloader
source
- the URIInputStream
IOException
- unable to fetchCopyright © 2013. All Rights Reserved.