com.ctc.wstx.util
Class URLUtil

java.lang.Object
  extended by com.ctc.wstx.util.URLUtil

public final class URLUtil
extends java.lang.Object


Method Summary
static java.io.InputStream optimizedStreamFromURL(java.net.URL url)
          Method that tries to get optimal stream to read from the specified URL.
static java.net.URL urlFromCurrentDir()
          Method that tries to create and return URL that denotes current working directory.
static java.net.URL urlFromSystemId(java.lang.String sysId)
          Method that tries to figure out how to create valid URL from a system id, without additional contextual information.
static java.net.URL urlFromSystemId(java.lang.String sysId, java.net.URL ctxt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

urlFromSystemId

public static java.net.URL urlFromSystemId(java.lang.String sysId)
                                    throws java.io.IOException
Method that tries to figure out how to create valid URL from a system id, without additional contextual information. If we could use URIs this might be easier to do, but they are part of JDK 1.4, and preferably code should only require 1.2 (or maybe 1.3)

Throws:
java.io.IOException

urlFromSystemId

public static java.net.URL urlFromSystemId(java.lang.String sysId,
                                           java.net.URL ctxt)
                                    throws java.io.IOException
Throws:
java.io.IOException

urlFromCurrentDir

public static java.net.URL urlFromCurrentDir()
                                      throws java.net.MalformedURLException
Method that tries to create and return URL that denotes current working directory. Usually used to create a context, when one is not explicitly passed.

Throws:
java.net.MalformedURLException

optimizedStreamFromURL

public static java.io.InputStream optimizedStreamFromURL(java.net.URL url)
                                                  throws java.io.IOException
Method that tries to get optimal stream to read from the specified URL. Currently it just means creating a simple file stream if the URL points to a (local) file.

Throws:
java.io.IOException