net.sf.zekr.common.util
Class UriUtils

java.lang.Object
  extended by net.sf.zekr.common.util.UriUtils

public class UriUtils
extends java.lang.Object

Simple URI utility methods.

Author:
Mohsen Saboorian

Constructor Summary
UriUtils()
           
 
Method Summary
static java.io.File toFile(java.lang.String url)
           
static java.lang.String toHttpUrl(java.lang.String addr, int port)
           
static java.lang.String toUri(java.io.File file)
           
static java.lang.String toUri(java.lang.String path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UriUtils

public UriUtils()
Method Detail

toUri

public static java.lang.String toUri(java.io.File file)
Parameters:
file - thr source file to return its URI.
Returns:
file:///path_to_file (replacing special characters with URLEncoding equivalents)

toUri

public static java.lang.String toUri(java.lang.String path)

toFile

public static java.io.File toFile(java.lang.String url)
                           throws java.net.URISyntaxException
Throws:
java.net.URISyntaxException

toHttpUrl

public static java.lang.String toHttpUrl(java.lang.String addr,
                                         int port)
                                  throws java.net.MalformedURLException
Throws:
java.net.MalformedURLException