Package org.ametys.cms
Class URIPrefixHandler
java.lang.Object
org.ametys.cms.URIPrefixHandler
- All Implemented Interfaces:
Component
,Contextualizable
Component providing base paths for computing URIs.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncomputeUriPrefix
(boolean absolute, boolean internal) Computes an URI prefix.void
contextualize
(Context context) Get the absolutized version of the context path.
Use it to create an absolute link beginning with the application root, for instance when sending a mail linking to the application.Get the application root.
-
Field Details
-
ROLE
Avalon role
-
-
Constructor Details
-
URIPrefixHandler
public URIPrefixHandler()
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
computeUriPrefix
Computes an URI prefix. Uses by variousURIResolver
.- Parameters:
absolute
- if the resulting prefix should be absolute.internal
- if the resulting prefix should be internal.- Returns:
- the computes prefix.
-
getUriPrefix
Get the application root. Can be empty if the application resides in the root context.
Use it to create a link beginning with the application root.- Returns:
- The application root uri.
-
getAbsoluteUriPrefix
Get the absolutized version of the context path.
Use it to create an absolute link beginning with the application root, for instance when sending a mail linking to the application.- Returns:
- The absolute context path.
-