Class FreemarkerURLHelper
java.lang.Object
com.peterphi.std.guice.freemarker.FreemarkerURLHelper
- Direct Known Subclasses:
DebugPerRequestFreemarkerURLHelper
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionjavax.ws.rs.core.UriBuilder
Return a UriBuilder for an absolute URIprotected String
javax.ws.rs.core.UriBuilder
context()
Returns a URL for a resource from the context pathReturn only the path for a given URLrelativeRest
(String path) Returns a relative URL for a resource from the REST path, assuming it is relative to another path on the same server.relativeRestConcat
(String path) Similar to therelativeRest
method, however this performs concatenation using String operations rather than UriBuilder, allowing the representation of URLs which are technically invalid (e.g.javax.ws.rs.core.UriBuilder
rest()
Returns a URL for a resource from the REST path (which may be different from the context path)restConcat
(String path) Similar to therest
method, however this performs concatenation using String operations rather than UriBuilder, allowing the representation of URLs which are technically invalid (e.g.
-
Constructor Details
-
FreemarkerURLHelper
-
-
Method Details
-
context
public javax.ws.rs.core.UriBuilder context() -
rest
public javax.ws.rs.core.UriBuilder rest() -
context
Returns a URL for a resource from the context path- Parameters:
path
-- Returns:
-
rest
Returns a URL for a resource from the REST path (which may be different from the context path)- Parameters:
path
-- Returns:
-
relativeRest
Returns a relative URL for a resource from the REST path, assuming it is relative to another path on the same server.- Parameters:
path
-- Returns:
-
restConcat
Similar to therest
method, however this performs concatenation using String operations rather than UriBuilder, allowing the representation of URLs which are technically invalid (e.g. using templates)- Parameters:
path
-- Returns:
-
relativeRestConcat
Similar to therelativeRest
method, however this performs concatenation using String operations rather than UriBuilder, allowing the representation of URLs which are technically invalid (e.g. using templates)- Parameters:
path
-- Returns:
-
absolute
Return a UriBuilder for an absolute URI- Parameters:
path
-- Returns:
-
relative
Return only the path for a given URL- Parameters:
url
-- Returns:
-
concat
-