net.ontopia.utils
Class URIUtils

java.lang.Object
  extended by net.ontopia.utils.URIUtils

public class URIUtils
extends java.lang.Object

INTERNAL: Utilities for working with URIs.

Since:
1.3.2

Constructor Summary
URIUtils()
           
 
Method Summary
static URILocator getFileURI(java.io.File file)
          INTERNAL: Given a File object, produce a corresponding URILocator object in the file: URI scheme.
static java.lang.String getFileURIString(java.io.File file)
          INTERNAL: Given a File object, produce a corresponding URI string object in the file: URI scheme.
static URILocator getURI(java.lang.String uri_or_filename)
          INTERNAL: Turns a string containing a url or a filename into a proper LocatorIF object.
static java.io.File getURIFile(LocatorIF file)
          INTERNAL: Given a URILocator in the file: URI scheme, produce the corresponding File object.
static URILocator getURILocator(java.lang.String uri)
          INTERNAL: Return URILocator from uri string.
static java.lang.String toHexString(byte n)
          INTERNAL: Make hex string for integer.
static java.net.URL toURL(java.io.File file)
          INTERNAL: Use this method instead of File.toURL() to get URLs for files.
static java.lang.String urlEncode(java.lang.String str, java.lang.String charenc)
          INTERNAL: URL-encodes the string by encoding reserved characters using %-codes.
 
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

getFileURI

public static URILocator getFileURI(java.io.File file)
INTERNAL: Given a File object, produce a corresponding URILocator object in the file: URI scheme.


getFileURIString

public static java.lang.String getFileURIString(java.io.File file)
INTERNAL: Given a File object, produce a corresponding URI string object in the file: URI scheme.

Since:
3.3.0

getURIFile

public static java.io.File getURIFile(LocatorIF file)
                               throws java.net.MalformedURLException
INTERNAL: Given a URILocator in the file: URI scheme, produce the corresponding File object.

Throws:
java.net.MalformedURLException
Since:
1.4

getURI

public static URILocator getURI(java.lang.String uri_or_filename)
INTERNAL: Turns a string containing a url or a filename into a proper LocatorIF object.


urlEncode

public static java.lang.String urlEncode(java.lang.String str,
                                         java.lang.String charenc)
                                  throws java.io.IOException
INTERNAL: URL-encodes the string by encoding reserved characters using %-codes.

Parameters:
str - String to be URL-encoded.
charenc - Character encoding to use in URL. Usually UTF-8.
Throws:
java.io.IOException

toHexString

public static java.lang.String toHexString(byte n)
INTERNAL: Make hex string for integer.


getURILocator

public static URILocator getURILocator(java.lang.String uri)
INTERNAL: Return URILocator from uri string.


toURL

public static java.net.URL toURL(java.io.File file)
                          throws java.net.MalformedURLException
INTERNAL: Use this method instead of File.toURL() to get URLs for files.

Throws:
java.net.MalformedURLException


Copyright © 2000-2012 Ontopia.