Package com.helger.photon.app.url
Class StreamOrLocalURIToURLConverter
java.lang.Object
com.helger.photon.app.url.StreamOrLocalURIToURLConverter
- All Implemented Interfaces:
IWebURIToURLConverter
The default implementation of
IWebURIToURLConverter that uses
LinkHelper.getStreamURL(IRequestWebScopeWithoutResponse, String) to
convert relative URIs to URLs. If you are using a different stream servlet
path, you may need to provide your own implementation and use it!- Author:
- Philip Helger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.helger.commons.io.resource.IReadableResourcegetAsResource(String sURI) Convert the passed URI to a resource.static com.helger.commons.io.resource.IReadableResourcegetAsResourceStatic(String sURI) com.helger.commons.url.SimpleURLConvert the passed URI to a URL.com.helger.commons.url.SimpleURLConvert the passed URI to a URL.static com.helger.commons.url.SimpleURLgetAsURLStatic(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope, String sURI) static com.helger.commons.url.SimpleURLgetAsURLStatic(String sURI) static final booleanisProjectRelativeURI(String sURI) Absolute paths are project relative files and therefore are relative to the servlet context directory
-
Constructor Details
-
StreamOrLocalURIToURLConverter
public StreamOrLocalURIToURLConverter()
-
-
Method Details
-
isProjectRelativeURI
Absolute paths are project relative files and therefore are relative to the servlet context directory- Parameters:
sURI- The String to check. May neither benullnor empty.- Returns:
trueif the URI starts with '/'
-
getAsResource
@Nonnull public com.helger.commons.io.resource.IReadableResource getAsResource(@Nonnull @Nonempty String sURI) Description copied from interface:IWebURIToURLConverterConvert the passed URI to a resource.- Specified by:
getAsResourcein interfaceIWebURIToURLConverter- Parameters:
sURI- The URI to be converted. May neither benullnor empty.- Returns:
- The created resource and never null.
-
getAsResourceStatic
-
getAsURL
Description copied from interface:IWebURIToURLConverterConvert the passed URI to a URL.- Specified by:
getAsURLin interfaceIWebURIToURLConverter- Parameters:
sURI- The URI to be converted. May neither benullnor empty.- Returns:
- The created URL.
-
getAsURLStatic
-
getAsURL
@Nonnull public com.helger.commons.url.SimpleURL getAsURL(@Nonnull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope, @Nonnull @Nonempty String sURI) Description copied from interface:IWebURIToURLConverterConvert the passed URI to a URL.- Specified by:
getAsURLin interfaceIWebURIToURLConverter- Parameters:
aRequestScope- The request web scope to be used. Required for cookie-less handling. May not benull.sURI- The URI to be converted.- Returns:
- The created URL.
-
getAsURLStatic
-