|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.uniba.euromath.tools.URLDir
public final class URLDir
Representation of directory, denoted by given URL.
Constructor Summary | |
---|---|
URLDir()
Creates instance of object with current directory. |
|
URLDir(String url)
Creates instance of object with given url. |
|
URLDir(URI uri)
Creates instance of object with given uri. |
|
URLDir(URL url)
Creates instance of object with given url. |
Method Summary | |
---|---|
static URLDir |
create(File file)
Creates object pointing onto given directory. |
static URL |
createURL(String url)
From given string creates an URL instance. |
static URL |
getCurrentDir()
Returns current dir, as an URL object. |
static String |
getFileName(String url)
Returns the last path part from given url, without the query and fragment parts. |
URI |
getURI()
Returns this instance as URI. |
URL |
getURL()
Returns this instance as URL. |
URL |
resolve(String uri)
Resolves given uri against this object. |
URL |
resolve(URI uri)
Resolves given uri against this object. |
URLDir |
resolveDir(String uri)
Resolves given uri against this object. |
String |
toString()
|
static URI |
toURI(URL url)
From given URL creates an URI instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public URLDir(String url) throws MalformedURLException, URISyntaxException
url
- url. Must denote a directory.
MalformedURLException
- if url is invalid.
URISyntaxException
- if url is invalid.public URLDir(URL url)
url
- url. Must denote a directory.public URLDir(URI uri) throws MalformedURLException
uri
- uri. Must denote a directory.
MalformedURLException
- if given uri is not a valid URIpublic URLDir()
Method Detail |
---|
public static URLDir create(File file)
file
- the file
public static URL getCurrentDir()
public URL resolve(String uri) throws MalformedURLException, URISyntaxException
URI.resolve
for details.
uri
- uri to resolve.
MalformedURLException
- if given uri is not a valid URI
URISyntaxException
- if given uri is not a valid URIpublic URL resolve(URI uri) throws MalformedURLException
URI.resolve
for details.
uri
- uri to resolve.
MalformedURLException
- if given uri is not a valid URIpublic URLDir resolveDir(String uri) throws MalformedURLException, URISyntaxException
URI.resolve
for details.
uri
- uri to resolve. Must be a directory.
MalformedURLException
- if given uri is not a valid URI
URISyntaxException
- if given uri is not a valid URIpublic String toString()
toString
in class Object
public static URI toURI(URL url)
url
- this string will be converted to URI object.
public static URL createURL(String url)
MalformedURLException
is thrown as an
IllegalArgumentException
.
url
- this string will be converted to URL object.
public URI getURI()
public URL getURL()
public static String getFileName(String url)
url
-
null
if none can be obtained.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |