public class URIUtil extends Object
Modifier and Type | Method and Description |
---|---|
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)
|
static URI |
toURI(IPath path)
|
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 . |
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 equalitytrue
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 convertnull
public static URI toURI(IPath path)
path
- The path to convertpublic 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 convertpublic 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 pathpublic 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
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.