edu.emory.mathcs.util.classloader
Class ResourceUtils

java.lang.Object
  extended byedu.emory.mathcs.util.classloader.ResourceUtils

public class ResourceUtils
extends java.lang.Object

Utility methods related to remote resource access.

Version:
1.0
Author:
Dawid Kurzyniec

Method Summary
static java.lang.String canonizePath(java.lang.String path)
          Returns the path converted to the canonic form.
static boolean isAbsolute(java.lang.String path)
           
static boolean isLocalFile(java.net.URI uri)
          Checks if the URI points to the local file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isLocalFile

public static boolean isLocalFile(java.net.URI uri)
Checks if the URI points to the local file.

Parameters:
uri - the uri to check
Returns:
true if the URI points to a local file

canonizePath

public static java.lang.String canonizePath(java.lang.String path)
Returns the path converted to the canonic form. Examples:
  "/aaa/b/"                                      ->  "/aaa/b/"
  "/aaa/b/c/../.."                               ->  "/aaa/"
  "/aaa/../bbb/cc/./.././../dd/eee/fff/."        ->  "/dd/eee/fff/"
  "../aaa/../././bbb/./../ccc/"                  ->  "../ccc/"
  "aa/ddfdd/./sadfd/.././sdafa/../../.././././"  ->  ""
  "./aaa/."                                      ->  "aaa/"
  ".///aa//bb/"                                  ->  "aa/bb/"
  "../../aaa"                                    ->  "../../aaa"
  "/../../aaa"                                   ->  "/aaa"
 


isAbsolute

public static boolean isAbsolute(java.lang.String path)