|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.common.url.URLUtil
public final class URLUtil
This utility class contains various URL-related static utility methods.
Method Summary | |
---|---|
static List<URL> |
buildURLList(URL[] baseURLs,
String urlSpecified)
This method is an attempt to standardize the way that URLs are constructed, and, more importantly, how they are converted into Streams or other i/o resources. |
static boolean |
exists(URL url)
Intended to be the equivalent of File.exists() . |
static boolean |
isDirectory(URL url)
Indicates whether a given URL references a directory. |
static String |
normalizeURISpecification(String input)
Converts standard-based uri-specification to a normalized String from which a java.net.URL instance can be constructed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static List<URL> buildURLList(URL[] baseURLs, String urlSpecified) throws MalformedURLException
This method is an attempt to standardize the way that URLs are constructed, and, more importantly, how they are converted into Streams or other i/o resources. There is no way to know when a URL is constructed whether it can actually be opened or not. So it is frequently the case that resources identified by URL must be tried several times as various possibilities are attempted. To standardize this, three possibilities were considered:
Of these three, 1 forces the URL to be opened twice, which was deemed wasteful. 2 seems like way too much trouble for such a simple task. An object would have to be created to manage the state information. 3, while somewhat wasteful, seems much less wasteful than the other two, and is the plan that was adopted.
baseURLs
- Array of URLs containing possible paths that should be
tried used as the base for relative URLs.urlSpecified
- String containing the name of the URL.
MalformedURLException
- If it is unable to create even one
URL instance.public static String normalizeURISpecification(String input)
input
- The uri-specification as defined in the XSL-FO Standard 1.0,
Section 5.11.
public static boolean exists(URL url)
File.exists()
.
url
- The URL whose existence is to be tested.
public static boolean isDirectory(URL url)
url
- The URL to be tested.
url
references a directory.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |