|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.refractions.udig.catalog.URLUtils
public class URLUtils
Utilities for dealing with the catalog's use of URLs as identifiers
Constructor Summary | |
---|---|
URLUtils()
|
Method Summary | |
---|---|
static java.net.URL |
constructURL(java.io.File reference,
java.lang.String url)
Creates a URL from the string. |
static java.net.URL |
toRelativePath(java.io.File reference,
java.net.URL destination)
Converts the URL to a URL indicating the relative path from the reference file to the location indicated by the destination URL. |
static boolean |
urlEquals(java.net.URL url1,
java.net.URL url2,
boolean stripRef)
Primarily for testing the comparison of URLS. |
static java.io.File |
urlToFile(java.net.URL url)
Takes a URL and converts it to a File. |
static java.lang.String |
urlToString(java.net.URL url1,
boolean ignoreRef)
Provides a standard way of converting to string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public URLUtils()
Method Detail |
---|
public static boolean urlEquals(java.net.URL url1, java.net.URL url2, boolean stripRef)
url1
- first url to compareurl2
- second urlstripRef
- if the reference should be ignored. For example searching for the IService
of a IGeoResource. The Service ID would not have a reference but the IGeoResource would so
ignore the reference in this case.
public static java.lang.String urlToString(java.net.URL url1, boolean ignoreRef)
url1
- url to convert to stringignoreRef
- wether to ignore te reference in the string.
public static java.net.URL toRelativePath(java.io.File reference, java.net.URL destination)
Examples:
destination = file:/c:\booger\data
return = file:/..\..\booger\data
destination = file:/d:\booger\data
return = file:/d:\booger\data
destination = http://booger.com\data
return = http://booger.com\data
reference
- the "from" file. The file that the relative path will start at. MUST BE A FILEdestination
- the URL to transform to a relative path
public static java.net.URL constructURL(java.io.File reference, java.lang.String url) throws java.net.MalformedURLException
destination = file:/..\..\booger\data
return = file:/c:\booger\data
reference
- the base of any relative path. MUST BE A FILEurl
- the url in string form.
java.net.MalformedURLException
public static java.io.File urlToFile(java.net.URL url)
url
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |