org.granite.util
Class URIUtil

java.lang.Object
  extended by org.granite.util.URIUtil

public class URIUtil
extends Object

Author:
Franck WOLFF

Field Summary
static String CLASSPATH_SCHEME
           
static String FILE_SCHEME
           
static Pattern WINDOWS_DRIVE_PATTERN
           
 
Constructor Summary
URIUtil()
           
 
Method Summary
static byte[] getContentAsBytes(URI uri)
           
static String getContentAsString(URI uri)
           
static String getContentAsString(URI uri, Charset charset)
           
static InputStream getInputStream(URI uri)
           
static InputStream getInputStream(URI uri, ClassLoader loader)
           
static String getSchemeSpecificPart(String path)
           
static String getSchemeSpecificPart(URI uri)
           
static boolean isAbsolute(String path)
           
static boolean isAbsolute(URI uri)
           
static boolean isFileURI(String path)
           
static boolean isFileURI(URI uri)
           
static long lastModified(URI uri)
           
static long lastModified(URL url)
           
static String normalize(String uri)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASSPATH_SCHEME

public static final String CLASSPATH_SCHEME
See Also:
Constant Field Values

FILE_SCHEME

public static final String FILE_SCHEME
See Also:
Constant Field Values

WINDOWS_DRIVE_PATTERN

public static final Pattern WINDOWS_DRIVE_PATTERN
Constructor Detail

URIUtil

public URIUtil()
Method Detail

normalize

public static String normalize(String uri)

isFileURI

public static boolean isFileURI(String path)
                         throws URISyntaxException
Throws:
URISyntaxException

isFileURI

public static boolean isFileURI(URI uri)

isAbsolute

public static boolean isAbsolute(String path)
                          throws URISyntaxException
Throws:
URISyntaxException

isAbsolute

public static boolean isAbsolute(URI uri)

getSchemeSpecificPart

public static String getSchemeSpecificPart(String path)
                                    throws URISyntaxException
Throws:
URISyntaxException

getSchemeSpecificPart

public static String getSchemeSpecificPart(URI uri)

getInputStream

public static InputStream getInputStream(URI uri,
                                         ClassLoader loader)
                                  throws IOException
Throws:
IOException

getInputStream

public static InputStream getInputStream(URI uri)
                                  throws IOException
Throws:
IOException

getContentAsString

public static String getContentAsString(URI uri)
                                 throws IOException
Throws:
IOException

getContentAsString

public static String getContentAsString(URI uri,
                                        Charset charset)
                                 throws IOException
Throws:
IOException

getContentAsBytes

public static byte[] getContentAsBytes(URI uri)
                                throws IOException
Throws:
IOException

lastModified

public static long lastModified(URI uri)
                         throws IOException
Throws:
IOException

lastModified

public static long lastModified(URL url)
                         throws IOException
Throws:
IOException