Package com.atlassian.bamboo.utils
Class UrlUtils
java.lang.Object
com.atlassian.bamboo.utils.UrlUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getPathUnderContext
(@NotNull String url, @NotNull String context) Given an URL which may: - include scheme,host and optionally port - start directly with context - start with an arbitrary path under a context this method returns the path under context.static boolean
Validate if passed URL uses HTTP or HTTPS schema or there's no indication that any type of schema is used altogether.
-
Constructor Details
-
UrlUtils
public UrlUtils()
-
-
Method Details
-
isSafeUrl
Validate if passed URL uses HTTP or HTTPS schema or there's no indication that any type of schema is used altogether. This method expects URL decoded value as input. It is safe to pass Struts' action parameter which is URL decoded and trimmed.- Parameters:
returnUrl
- URL decoded value of returnUrl query param
-
getPathUnderContext
public static String getPathUnderContext(@NotNull @NotNull String url, @NotNull @NotNull String context) Given an URL which may: - include scheme,host and optionally port - start directly with context - start with an arbitrary path under a context this method returns the path under context. It should not be used for security purposes, because it operates on best effort basis - including returning the URL without modifications if context is not found .- See Also:
-
for context description
-