Package org.dspace.app.rest.utils
Class URLUtils
java.lang.Object
org.dspace.app.rest.utils.URLUtils
Utility class to encode or decode URL
-
Method Summary
-
Method Details
-
decode
Decode a given URL- Parameters:
url- URL- Returns:
- decoded URL
-
encode
Encode a given URL- Parameters:
url- URL- Returns:
- encoded URL
-
urlIsPrefixOf
public static boolean urlIsPrefixOf(String pattern, String candidate) throws IllegalArgumentException Is one URL a prefix of another? Ignores credentials, fragments and queries.- Parameters:
pattern- the potential prefix.candidate- does this URL match the pattern?- Returns:
trueif the URLs have equal protocol, host and port, and each element ofcandidate's pathString.equals(java.lang.Object)the corresponding element inpattern's path.- Throws:
IllegalArgumentException- if either URL is malformed.
-