Eclipse Platform
Release 3.3

org.eclipse.core.filesystem
Class URIUtil

java.lang.Object
  extended byorg.eclipse.core.filesystem.URIUtil

public class URIUtil
extends Object

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.

This class is not intended to be instantiated or subclassed.

Since:
org.eclipse.core.filesystem 1.0

Method Summary
static boolean equals(URI one, URI two)
          Tests two URIs for equality.
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equals

public static boolean equals(URI one,
                             URI two)
Tests two URIs for equality. This method delegates equality testing to the registered file system for the URIs. If either URI does not have a registered file system, the default URI.equals(Object) method is used.

Parameters:
one - The first URI to test for equality
two - The second URI to test for equality
Returns:
true if the first URI is equal to the second, as defined by the file systems for those URIs, and false otherwise.

toPath

public 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.

Parameters:
uri - The URI to convert
Returns:
The path representing the provided URI, null

toURI

public static URI toURI(IPath path)
Converts an IPath representing a local file system path to a URI.

Parameters:
path - The path to convert
Returns:
The URI representing the provided path

toURI

public static URI toURI(String pathString)
Converts a String representing a local file system path to a URI. For example, this method can be used to create a URI from the output of File.getAbsolutePath().

Parameters:
pathString - The path string to convert
Returns:
The URI representing the provided path string

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.