public class UrlLib
extends java.lang.Object
| Constructor and Description |
|---|
UrlLib() |
| Modifier and Type | Method and Description |
|---|---|
static java.net.URL |
createURL(java.io.File file) |
static java.net.URL |
createURL(java.lang.String urlString)
Creates a new URL.
|
static java.net.URL |
createURL(java.net.URL base,
java.lang.String path)
Creates a new URL from a base URL.
|
static java.lang.String |
decode(java.lang.String string) |
static Naming<java.lang.String> |
decodeFormParameters(java.lang.String coded)
Decodes parameters from the HTTP GET format.
|
static long |
download(java.net.URL source,
java.io.File dest)
Downloads a file from URL source to File destination.
|
static long |
download(java.net.URL source,
VfsFile dest)
Downloads a file from URL source to File destination.
|
static java.lang.String |
encode(java.lang.String string) |
static boolean |
exists(java.net.URL url)
Checks for existence of a file at the given URL.
|
static boolean |
exists(java.net.URL base,
java.lang.String path) |
static java.util.List<java.lang.String> |
parseFileLinks(java.net.URL source) |
static java.lang.String |
readLine(java.net.URL source) |
static java.lang.String |
readLine(java.net.URL base,
java.lang.String path) |
static java.util.List<java.lang.String> |
readLines(java.net.URL source) |
static java.util.List<java.lang.String> |
readLines(java.net.URL base,
java.lang.String path) |
static long |
upload(java.io.File source,
java.net.URL dest)
Uploads a file from local store to a URL destination.
|
static long |
upload(VfsFile source,
java.net.URL dest)
Uploads a file from local store to a URL destination.
|
static long |
uploadQuietly(VfsFile source,
java.net.URL dest)
Similar to upload(), but does not resolve the host name via HostsLib.resolveHost(), and never
prints the URL.
|
public static java.lang.String encode(java.lang.String string)
public static java.lang.String decode(java.lang.String string)
public static Naming<java.lang.String> decodeFormParameters(java.lang.String coded)
public static java.net.URL createURL(java.lang.String urlString)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionpublic static java.net.URL createURL(java.net.URL base,
java.lang.String path)
throws java.net.MalformedURLException
java.net.MalformedURLExceptionpublic static java.net.URL createURL(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic static long download(java.net.URL source,
java.io.File dest)
throws java.io.IOException
java.io.IOExceptionpublic static long download(java.net.URL source,
VfsFile dest)
throws java.io.IOException
java.io.IOExceptionpublic static long upload(java.io.File source,
java.net.URL dest)
throws java.io.IOException
java.io.IOExceptionpublic static long upload(VfsFile source, java.net.URL dest) throws java.io.IOException
java.io.IOExceptionpublic static long uploadQuietly(VfsFile source, java.net.URL dest) throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String readLine(java.net.URL source)
throws java.io.IOException
java.io.IOExceptionpublic static java.util.List<java.lang.String> readLines(java.net.URL source)
throws java.io.IOException
java.io.IOExceptionpublic static java.util.List<java.lang.String> parseFileLinks(java.net.URL source)
throws java.io.IOException
java.io.IOExceptionpublic static java.lang.String readLine(java.net.URL base,
java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic static java.util.List<java.lang.String> readLines(java.net.URL base,
java.lang.String path)
throws java.io.IOException
java.io.IOExceptionpublic static boolean exists(java.net.URL url)
throws java.io.IOException
java.io.IOExceptionpublic static boolean exists(java.net.URL base,
java.lang.String path)
throws java.io.IOException
java.io.IOException