Package org.xwiki.url.script
Class URLSecurityScriptService
- java.lang.Object
-
- org.xwiki.url.script.URLSecurityScriptService
-
- All Implemented Interfaces:
org.xwiki.script.service.ScriptService
@Component @Named("security.url") @Singleton @Unstable public class URLSecurityScriptService extends Object implements org.xwiki.script.service.ScriptService
Script service for security related checks from URL and URI.- Since:
- 14.10.4, 15.0
- Version:
- $Id: 48af267834c3df33786c0737819c3043b28bdc6a $
-
-
Constructor Summary
Constructors Constructor Description URLSecurityScriptService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description URI
parseToSafeURI(String uriRepresentation)
Parse the given string to create a URI that is safe to use.
-
-
-
Method Detail
-
parseToSafeURI
public URI parseToSafeURI(String uriRepresentation) throws URISyntaxException, SecurityException
Parse the given string to create a URI that is safe to use. This method returns null if the parsed URI is not safe to use according toURLSecurityManager.isURITrusted(URI)
. It might also throw aURISyntaxException
if the parameter cannot be properly parsed.- Parameters:
uriRepresentation
- a string representing a URI that needs to be parsed.- Returns:
- a URI safe to use or
null
- Throws:
URISyntaxException
- if the given parameter cannot be properly parsedSecurityException
- See Also:
URLSecurityManager.parseToSafeURI(String)
-
-