public final class URLs extends Object
Modifier and Type | Method and Description |
---|---|
static URI |
asURI(File file) |
static URI |
asURI(String url) |
static URI |
asURI(URL url) |
static URL |
asURL(File file) |
static URL |
asURL(String url) |
static URL |
asURL(URI url) |
static URI |
encode(URL url) |
static URL |
getResourceFromJAR(String resource,
Class<?> context) |
static Iterator<String> |
listResourcesFromJAR(String directory,
Class<?> context) |
static URI |
relativize(URI base,
URI url) |
static URI |
resolve(URI base,
URI url) |
public static URL asURL(String url)
url
- An encoded absolute URLIllegalArgumentException
public static URL asURL(URI url)
url
- An encoded absolute URLIllegalArgumentException
public static URI asURI(String url)
url
- An encoded absolute or relative URLIllegalArgumentException
public static URI asURI(URL url)
url
- An encoded absolute or relative URLIllegalArgumentException
public static URI encode(URL url)
url
- An unencoded absolute URLpublic static URI resolve(URI base, URI url)
base
- An encoded absolute or relative URLurl
- An encoded absolute or relative URLpublic static URI relativize(URI base, URI url)
base
- An encoded absolute or relative URLurl
- An encoded absolute or relative URLpublic static URL getResourceFromJAR(String resource, Class<?> context)
resource
- The (not URL-encoded) path of a resource inside the specified JAR or class directorycontext
- A class from the JAR or class directory that is to be searched for resourcespublic static Iterator<String> listResourcesFromJAR(String directory, Class<?> context)
resource
- The (not URL-encoded) path of a directory inside the specified JAR or class directorycontext
- A class from the JAR or class directory that is to be searched for resourcesCopyright © 2010–2024 The DAISY Consortium. All rights reserved.