public class RMURLUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
RMURLUtils.Header
A class to hold headers.
|
static class |
RMURLUtils.PermissiveClassLoader
A URL class loader that defaults to all permissions.
|
static class |
RMURLUtils.Response
A class to hold URL response.
|
Modifier and Type | Field and Description |
---|---|
static int |
BAD_REQUEST |
static int |
FORBIDDEN |
static int |
NOT_FOUND |
static int |
SUCCESS |
static int |
UNAUTHORIZED |
Constructor and Description |
---|
RMURLUtils() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
doPost(java.net.URL aURL,
byte[] theBytes)
Posts the given bytes to URL.
|
static byte[] |
getBytes(java.net.URL aURL)
Returns bytes for url.
|
static byte[] |
getBytes(java.net.URLConnection aConnection,
RMUtils.ProgressListener aListener)
Returns bytes for connection.
|
static java.io.File |
getFile(java.net.URL aURL)
Returns the URL as a file.
|
static java.io.InputStream |
getInputStream(java.net.URL aURL)
Returns an input stream for a URL.
|
static java.io.InputStream |
getInputStream(java.net.URLConnection aConnection)
Returns an input stream for a URL connection.
|
static java.io.File |
getLocalFile(java.net.URL aURL)
Returns the given URL as a file (downloading to temp dir, if necessary).
|
static java.io.File |
getLocalFile(java.net.URL aURL,
java.io.File aFile)
Returns the given URL as given file by downloading it.
|
static java.io.File |
getLocalFile(java.net.URL aURL,
java.io.File aFile,
RMUtils.ProgressListener aListener)
Returns the given URL as given file by downloading it.
|
static java.io.File |
getLocalFileDestination(java.net.URL aURL,
java.io.File aFile)
Returns the destination file that the given URL would be saved to using the getLocalFile method.
|
static java.lang.String |
getRedirectString(java.lang.String aURLString)
Returns a redirect string.
|
static RMURLUtils.Response |
getResponse(java.net.URL aURL,
java.lang.String aCookie,
byte[] theBytes,
RMURLUtils.Header... theHeaders)
Returns a response for a URL.
|
static java.lang.String |
getResponseCodeString(int aCode)
Returns a string for an HTTP response code.
|
static java.net.URI |
getURI(java.lang.String aURLString)
Returns a URL for given string.
|
static java.net.URL |
getURL(java.lang.Object aSource)
Returns a URL object given an arbitrary source.
|
static boolean |
isLocal(java.net.URL aURL)
Returns whether a URL is local.
|
static void |
openURL(java.lang.String aName)
Tries to open the given URL with the platform reader.
|
static java.lang.Exception |
sendCGIEmail(java.lang.String aURLString,
java.util.Map aMap)
Send CGI Email.
|
static java.lang.Exception |
sendCGIEmail(java.net.URL aURL,
java.util.Map aMap)
Send CGI Email.
|
public static final int SUCCESS
public static final int BAD_REQUEST
public static final int UNAUTHORIZED
public static final int FORBIDDEN
public static final int NOT_FOUND
public static java.net.URL getURL(java.lang.Object aSource)
public static java.net.URI getURI(java.lang.String aURLString)
public static java.lang.String getRedirectString(java.lang.String aURLString)
public static void openURL(java.lang.String aName)
public static byte[] getBytes(java.net.URL aURL)
public static byte[] getBytes(java.net.URLConnection aConnection, RMUtils.ProgressListener aListener)
public static java.io.InputStream getInputStream(java.net.URL aURL)
public static java.io.InputStream getInputStream(java.net.URLConnection aConnection)
public static java.lang.String doPost(java.net.URL aURL, byte[] theBytes) throws java.io.IOException
java.io.IOException
public static RMURLUtils.Response getResponse(java.net.URL aURL, java.lang.String aCookie, byte[] theBytes, RMURLUtils.Header... theHeaders) throws java.io.IOException
java.io.IOException
public static java.lang.String getResponseCodeString(int aCode)
public static boolean isLocal(java.net.URL aURL)
public static java.io.File getFile(java.net.URL aURL)
public static java.io.File getLocalFile(java.net.URL aURL)
public static java.io.File getLocalFile(java.net.URL aURL, java.io.File aFile)
public static java.io.File getLocalFile(java.net.URL aURL, java.io.File aFile, RMUtils.ProgressListener aListener)
public static java.io.File getLocalFileDestination(java.net.URL aURL, java.io.File aFile)
public static java.lang.Exception sendCGIEmail(java.lang.String aURLString, java.util.Map aMap)
public static java.lang.Exception sendCGIEmail(java.net.URL aURL, java.util.Map aMap)