com.openexchange.admin.rmi.utils
Class URIParser

java.lang.Object
  extended by com.openexchange.admin.rmi.utils.URIParser

public final class URIParser
extends java.lang.Object

URIParser

Author:
Marcus Klein

Method Summary
static boolean isValid(java.lang.String input)
          Checks if specified input is a valid URI.
static java.net.URI parse(java.lang.String input, URIDefaults defaults)
          Parses specified URL string.
static java.net.URI sanitize(java.lang.String input, URIDefaults defaults)
          Tries to sanitize specified broken URI string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parse

public static java.net.URI parse(java.lang.String input,
                                 URIDefaults defaults)
                          throws java.net.URISyntaxException
Parses specified URL string.

Parameters:
input - The URL string
defaults - The defaults for parsing or URIDefaults.NULL for no defaults
Returns:
The parsed URI instance
Throws:
java.net.URISyntaxException - If parsing fails

isValid

public static boolean isValid(java.lang.String input)
Checks if specified input is a valid URI.

Parameters:
input - The input to check
Returns:
true if specified input is a valid URI; otherwise false

sanitize

public static java.net.URI sanitize(java.lang.String input,
                                    URIDefaults defaults)
Tries to sanitize specified broken URI string.

Parameters:
input - The broken URI string
defaults - The defaults for parsing
Returns:
The sanitized URI or null if not able to sanitize