public class StreamOrLocalURIToURLConverter extends Object implements IWebURIToURLConverter
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!| Constructor and Description |
|---|
StreamOrLocalURIToURLConverter() |
| Modifier and Type | Method and Description |
|---|---|
com.helger.commons.io.resource.IReadableResource |
getAsResource(String sURI)
Convert the passed URI to a resource.
|
static com.helger.commons.io.resource.IReadableResource |
getAsResourceStatic(String sURI) |
com.helger.commons.url.SimpleURL |
getAsURL(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope,
String sURI)
Convert the passed URI to a URL.
|
com.helger.commons.url.SimpleURL |
getAsURL(String sURI)
Convert the passed URI to a URL.
|
static com.helger.commons.url.SimpleURL |
getAsURLStatic(com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope,
String sURI) |
static com.helger.commons.url.SimpleURL |
getAsURLStatic(String sURI) |
static boolean |
isProjectRelativeURI(String sURI)
Absolute paths are project relative files and therefore are relative to the
servlet context directory
|
public static final boolean isProjectRelativeURI(@Nonnull @Nonempty String sURI)
sURI - The String to check. May neither be null nor empty.true if the URI starts with '/'@Nonnull public com.helger.commons.io.resource.IReadableResource getAsResource(@Nonnull @Nonempty String sURI)
IWebURIToURLConvertergetAsResource in interface IWebURIToURLConvertersURI - The URI to be converted. May neither be null nor empty.@Nonnull public static com.helger.commons.io.resource.IReadableResource getAsResourceStatic(@Nonnull @Nonempty String sURI)
@Nonnull public com.helger.commons.url.SimpleURL getAsURL(@Nonnull @Nonempty String sURI)
IWebURIToURLConvertergetAsURL in interface IWebURIToURLConvertersURI - The URI to be converted. May neither be null nor empty.@Nonnull public static com.helger.commons.url.SimpleURL getAsURLStatic(@Nonnull @Nonempty String sURI)
@Nonnull public com.helger.commons.url.SimpleURL getAsURL(@Nonnull com.helger.web.scope.IRequestWebScopeWithoutResponse aRequestScope, @Nonnull @Nonempty String sURI)
IWebURIToURLConvertergetAsURL in interface IWebURIToURLConverteraRequestScope - The request web scope to be used. Required for cookie-less handling.
May not be null.sURI - The URI to be converted.Copyright © 2014–2023 Philip Helger. All rights reserved.