public final class OfbizUrlBuilder extends Object
Modifier and Type | Method and Description |
---|---|
boolean |
buildFullUrl(Appendable buffer,
String url,
boolean useSSL)
Builds a full URL - including scheme, host, servlet path and resource.
|
boolean |
buildHostPart(Appendable buffer,
String url,
boolean useSSL)
Builds a partial URL - including the scheme and host, but not the servlet path or resource.
|
void |
buildPathPart(Appendable buffer,
String url)
Builds a partial URL - including the servlet path and resource, but not the scheme or host.
|
static OfbizUrlBuilder |
from(ComponentConfig.WebappInfo webAppInfo,
Delegator delegator)
Returns an
OfbizUrlBuilder instance. |
static OfbizUrlBuilder |
from(HttpServletRequest request)
Returns an
OfbizUrlBuilder instance. |
public static final String module
public static OfbizUrlBuilder from(HttpServletRequest request) throws GenericEntityException, WebAppConfigurationException
OfbizUrlBuilder
instance.request
- GenericEntityException
WebAppConfigurationException
public static OfbizUrlBuilder from(ComponentConfig.WebappInfo webAppInfo, Delegator delegator) throws WebAppConfigurationException, IOException, SAXException, GenericEntityException
OfbizUrlBuilder
instance. Use this method when you
don't have a HttpServletRequest
object - like in scheduled jobs.webAppInfo
- Optional - if null
, the builder can only build the host part,
and that will be based only on the settings in url.properties
(the WebSite
entity will be ignored).delegator
- WebAppConfigurationException
IOException
SAXException
GenericEntityException
public boolean buildFullUrl(Appendable buffer, String url, boolean useSSL) throws WebAppConfigurationException, IOException
buffer
- url
- useSSL
- Default value to use - will be replaced by request-map setting
if one is found.true
if the URL uses httpsWebAppConfigurationException
IOException
public boolean buildHostPart(Appendable buffer, String url, boolean useSSL) throws WebAppConfigurationException, IOException
buffer
- url
- useSSL
- Default value to use - will be replaced by request-map setting
if one is found with security=true set.true
if the URL uses httpsWebAppConfigurationException
IOException
public void buildPathPart(Appendable buffer, String url) throws WebAppConfigurationException, IOException
buffer
- url
- WebAppConfigurationException
IOException