public class UrlRequester extends Object
Supported URL protocols are those standards plus classpath protocol.
| Modifier and Type | Field and Description |
|---|---|
static String |
CLASSPATH_PROTOCOL |
| Constructor and Description |
|---|
UrlRequester() |
| Modifier and Type | Method and Description |
|---|---|
static List<String> |
downloadList(String url)
will download a external resource and read the content of the file that will then be translated into a
new list.
|
static String |
getFromUrl(String url)
Returns the content of the resource pointed by the given URL as a string.
|
static String |
getFromUrl(String url,
String encoding)
Returns the content of the resource pointed by the given URL as a string.
|
static boolean |
isStringUrl(String data)
Checks if the given input is a URL value.
|
public static final String CLASSPATH_PROTOCOL
public static boolean isStringUrl(String data)
data - the license string or a URLpublic static String getFromUrl(String url) throws IOException
url - the resource destination that is expected to contain pure textIOException - If an I/O error occurs when retrieve of the content URLpublic static String getFromUrl(String url, String encoding) throws IOException
url - the resource destination that is expected to contain pure textencoding - the resource content encodingIOException - If an I/O error occurs when retrieve of the content URLpublic static List<String> downloadList(String url) throws org.apache.maven.plugin.MojoExecutionException
url - the URL to the external resourceorg.apache.maven.plugin.MojoExecutionExceptionCopyright © 2010–2019 MojoHaus. All rights reserved.