org.apache.fop.tools
Class URLBuilder

java.lang.Object
  extended byorg.apache.fop.tools.URLBuilder

public class URLBuilder
extends java.lang.Object

This utility class is used to build URLs from Strings. The String can be normal URLs but also just filenames. The filenames get converted to a file URL.

Author:
Jeremias Maerki

Constructor Summary
URLBuilder()
           
 
Method Summary
static java.net.URL buildURL(java.lang.String spec)
          Build an URL based on a String.
static java.net.URL buildURL(java.net.URL baseURL, java.lang.String spec)
          Build an URL based on a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLBuilder

public URLBuilder()
Method Detail

buildURL

public static java.net.URL buildURL(java.lang.String spec)
                             throws java.net.MalformedURLException
Build an URL based on a String. The String can be a normal URL or a filename. Filenames get automatically converted to to URLs.

Parameters:
spec - A URL or a filename
Returns:
The requested URL
Throws:
java.net.MalformedURLException - If spec cannot be converted to a URL.

buildURL

public static java.net.URL buildURL(java.net.URL baseURL,
                                    java.lang.String spec)
                             throws java.net.MalformedURLException
Build an URL based on a String. The String can be a normal URL or a filename. Filenames get automatically converted to to URLs.

Parameters:
baseURL - Base URL for relative paths
spec - A URL or a filename
Returns:
The requested URL
Throws:
java.net.MalformedURLException - If spec cannot be converted to a URL.


Copyright © 1999-2003 Apache Software Foundation. All Rights Reserved.