public class URLUtilities
extends java.lang.Object
URLUtiliites
is a collection of common
URL utility functions. All methods are declared as static. Supported
operations include expanding a file URL, reading the data from a URL
and returning it as a string, and enabling HTTPS support.Constructor and Description |
---|
URLUtilities() |
Modifier and Type | Method and Description |
---|---|
static void |
enableHTTPS()
Try to enable HTTPS support.
|
static java.lang.String |
expandURL(java.lang.String url)
Expand an improperly formatted file URL to a properly formatted URL.
|
static java.lang.String |
readURL(java.lang.String url)
Read data from a properly formatted URL and return it as a string.
|
public static java.lang.String readURL(java.lang.String url) throws java.net.MalformedURLException, java.io.IOException
MalformedURLException
if the
URL is improperly formatted or an IOException
if there
is a problem reading the URL data.java.net.MalformedURLException
java.io.IOException
public static java.lang.String expandURL(java.lang.String url)
public static void enableHTTPS()
URL
with an HTTPS protocol.
This enables HTTPS through the Sun JSSE
library. If
this library does not exist, then HTTPS is not enabled.