dk.brics.misc
Class Loader

java.lang.Object
  extended by dk.brics.misc.Loader

public class Loader
extends Object

String loader.


Method Summary
static String getString(String u, String charset)
          Returns the contents of the given resource (file path or URL) as a string.
static String resolveRelative(String base, String u)
          Resolves relative paths/URLs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getString

public static String getString(String u,
                               String charset)
                        throws IOException
Returns the contents of the given resource (file path or URL) as a string.

Parameters:
u - file path or URL
charset - character encoding (if null, use system default)
Returns:
contents
Throws:
IOException

resolveRelative

public static String resolveRelative(String base,
                                     String u)
                              throws MalformedURLException
Resolves relative paths/URLs.

Parameters:
base - base path/URL
u - path/URL to resolve (relative or absolute)
Returns:
absolute URL
Throws:
MalformedURLException


Copyright © 2005-2008 Anders Møller.