|
Eclipse Platform Release 3.4 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.filesystem.URIUtil
This class provides utility methods for comparing, inspecting, and manipulating URIs. More specifically, this class is useful for dealing with URIs that represent file systems represented by the org.eclipse.core.filesystem.filesystems extension point. For such URIs the file system implementation can be consulted to interpret the URI in a way that is not possible at a generic level.
Method Summary | |
static boolean |
equals(URI one,
URI two)
Tests two URIs for equality. |
static String |
toDecodedString(URI uri)
Returns a string representation of the URI in a form suitable for human consumption. |
static IPath |
toPath(URI uri)
Returns an IPath representing this URI
in the local file system, or null if this URI does
not represent a file in the local file system. |
static URI |
toURI(IPath path)
Converts an IPath representing a local file system path to a URI . |
static URI |
toURI(String pathString)
Converts a String representing a local file system path to a URI .
|
static URI |
toURI(String pathString,
boolean forceAbsolute)
Converts a String representing a local file system path to a URI .
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static boolean equals(URI one, URI two)
URI.equals(Object)
method is used.
one
- The first URI to test for equalitytwo
- The second URI to test for equality
true
if the first URI is equal to the second,
as defined by the file systems for those URIs, and false
otherwise.public static IPath toPath(URI uri)
IPath
representing this URI
in the local file system, or null
if this URI does
not represent a file in the local file system.
uri
- The URI to convert
null
public static URI toURI(IPath path)
IPath
representing a local file system path to a URI
.
path
- The path to convert
public static URI toURI(String pathString)
URI
.
For example, this method can be used to create a URI from the output
of File.getAbsolutePath()
. The provided path string is always treated
as an absolute path.
pathString
- The absolute path string to convert
public static URI toURI(String pathString, boolean forceAbsolute)
URI
.
For example, this method can be used to create a URI from the output
of File.getAbsolutePath()
.
The forceAbsolute
flag controls how this method handles
relative paths. If the value is true
, then the input path
is always treated as an absolute path, and the returned URI will be an
absolute URI. If the value is false
, then a relative path
provided as input will result in a relative URI being returned.
pathString
- The path string to convertforceAbsolute
- if true
the path is treated as an
absolute path
public static String toDecodedString(URI uri)
The string returned by this method is equivalent to that returned by the
URI.toString()
method except that all sequences of escaped octets are decoded.
uri
- The URI to return in string form
|
Eclipse Platform Release 3.4 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.