Package com.thaiopensource.util
Class Uri
- java.lang.Object
-
- com.thaiopensource.util.Uri
-
public class Uri extends Object
-
-
Constructor Summary
Constructors Constructor Description Uri()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
escapeDisallowedChars(String s)
static boolean
hasFragmentId(String uri)
Tests whether a valid URI reference has a fragment identifier.static boolean
isAbsolute(String uri)
Tests whether a valid URI reference is absolute.static boolean
isValid(String s)
Tests whether a string is a valid URI reference.static String
resolve(String base, String uriReference)
-
-
-
Method Detail
-
isValid
public static boolean isValid(String s)
Tests whether a string is a valid URI reference.- Parameters:
s
- the String to be tested- Returns:
- true is s is a valid URI reference, false otherwise
-
hasFragmentId
public static boolean hasFragmentId(String uri)
Tests whether a valid URI reference has a fragment identifier. It is allowed to pass an invalid URI reference, but the result is not defined.- Parameters:
uri
- the URI reference to be tested, must not be null- Returns:
- true if the URI reference has a fragment identifier, false otherwise
-
isAbsolute
public static boolean isAbsolute(String uri)
Tests whether a valid URI reference is absolute. It is allowed to pass an invalid URI reference, but the result is not defined. It is also allowed to pass a valid URI with leading and trailing whitespace.- Parameters:
uri
- the URI to be tested, must not be null- Returns:
- true if the URI reference is absolute, false otherwise
-
-