com.metamatrix.common.extensionmodule.protocol
Class URLFactory

java.lang.Object
  extended by com.metamatrix.common.extensionmodule.protocol.URLFactory

public class URLFactory
extends java.lang.Object

Factory to convert String urls into URL objects. This factory will instantiate both "normal" URLs as well as special MetaMatrix extension module URLs (URLs of resources in the MetaMatrix store of extension modules).


Field Summary
static java.lang.String MM_JAR_PROTOCOL
          The protocol of a MetaMatrix jar file extension module URL
 
Method Summary
static java.lang.String getFileName(java.lang.String url)
          Utility method needed by extension module framework, should not be called directly.
static java.net.URL parseURL(java.lang.String url)
          Parse the url string into a URL object
static java.net.URL parseURL(java.net.URL context, java.lang.String url)
          Parse the url string into a URL object within the given context.
static java.net.URL[] parseURLs(java.util.List urls)
          Parse the List of string urls into an array of URL objects
static java.net.URL[] parseURLs(java.lang.String delimitedURLs, java.lang.String delimiter)
          Parse the single delimited String of URLs into an array of URL objects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MM_JAR_PROTOCOL

public static final java.lang.String MM_JAR_PROTOCOL
The protocol of a MetaMatrix jar file extension module URL

See Also:
Constant Field Values
Method Detail

getFileName

public static java.lang.String getFileName(java.lang.String url)
Utility method needed by extension module framework, should not be called directly.


parseURL

public static java.net.URL parseURL(java.net.URL context,
                                    java.lang.String url)
                             throws java.net.MalformedURLException
Parse the url string into a URL object within the given context.

Parameters:
context - URL the context within which to parse the url string.
url - String url
Returns:
URL object
Throws:
java.net.MalformedURLException - if url String is invalid

parseURL

public static java.net.URL parseURL(java.lang.String url)
                             throws java.net.MalformedURLException
Parse the url string into a URL object

Parameters:
url - String url
Returns:
URL object
Throws:
java.net.MalformedURLException - if url String is invalid

parseURLs

public static java.net.URL[] parseURLs(java.util.List urls)
                                throws java.net.MalformedURLException
Parse the List of string urls into an array of URL objects

Parameters:
urls - List of String urls
Returns:
array of URL objects
Throws:
java.net.MalformedURLException - if any of the url Strings are invalid

parseURLs

public static java.net.URL[] parseURLs(java.lang.String delimitedURLs,
                                       java.lang.String delimiter)
                                throws java.net.MalformedURLException
Parse the single delimited String of URLs into an array of URL objects

Parameters:
delimitedURLs - a single String of delimiter-separated URL strings
delimiter - delimiter of tokens in delmitedURLs - if this is null, a single whitespace will be assumed as the delimiter
Returns:
URL[] array
Throws:
java.net.MalformedURLException - if any of the url Strings are invalid


Copyright © 2009. All Rights Reserved.