public class UrlReader extends Object
| Modifier | Constructor and Description |
|---|---|
protected |
UrlReader(URL baseUrl) |
| Modifier and Type | Method and Description |
|---|---|
protected InputStream |
doOpen(URL url) |
protected URL |
extendBaseUrl(String suffix) |
static UrlReader |
fromUri(URI uri,
String username,
String password) |
URL |
getBaseURL()
Mainly used for test purposes, othewise not really useful.
|
InputStream |
openStream(String path)
Open an input stream to specifed relative url.
|
String |
toString() |
void |
validate()
Validate that the reader is operational.
|
protected final URL baseUrl
protected UrlReader(URL baseUrl)
public static UrlReader fromUri(URI uri, String username, String password) throws MalformedURLException
MalformedURLExceptionpublic void validate()
throws IOException,
URISyntaxException
IOExceptionURISyntaxExceptionpublic final InputStream openStream(String path) throws IOException
path - A path that is relative to the baseurl and references a file within the repo.IOException - On all errors.protected InputStream doOpen(URL url) throws IOException
IOExceptionpublic URL getBaseURL()
protected URL extendBaseUrl(String suffix) throws MalformedURLException
MalformedURLExceptionCopyright © 2008-2013 Red Hat, Inc.. All Rights Reserved.