Package org.apache.ofbiz.webapp
Class OfbizUrlBuilder
- java.lang.Object
-
- org.apache.ofbiz.webapp.OfbizUrlBuilder
-
public final class OfbizUrlBuilder extends java.lang.Object
OFBiz URL builder.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
buildFullUrl(java.lang.Appendable buffer, java.lang.String url, boolean useSSL)
Builds a full URL - including scheme, host, servlet path and resource.boolean
buildHostPart(java.lang.Appendable buffer, java.lang.String url, boolean useSSL)
Builds a partial URL - including the scheme and host, but not the servlet path or resource.void
buildPathPart(java.lang.Appendable buffer, java.lang.String url)
Builds a partial URL - including the servlet path and resource, but not the scheme or host.static OfbizUrlBuilder
from(javax.servlet.http.HttpServletRequest request)
Returns anOfbizUrlBuilder
instance.static OfbizUrlBuilder
from(ComponentConfig.WebappInfo webAppInfo, Delegator delegator)
Returns anOfbizUrlBuilder
instance.
-
-
-
Method Detail
-
from
public static OfbizUrlBuilder from(javax.servlet.http.HttpServletRequest request) throws GenericEntityException, WebAppConfigurationException
Returns anOfbizUrlBuilder
instance.- Parameters:
request
-- Throws:
GenericEntityException
WebAppConfigurationException
-
from
public static OfbizUrlBuilder from(ComponentConfig.WebappInfo webAppInfo, Delegator delegator) throws WebAppConfigurationException, java.io.IOException, org.xml.sax.SAXException, GenericEntityException
Returns anOfbizUrlBuilder
instance. Use this method when you don't have aHttpServletRequest
object - like in scheduled jobs.- Parameters:
webAppInfo
- Optional - ifnull
, the builder can only build the host part, and that will be based only on the settings inurl.properties
(the WebSite entity will be ignored).delegator
-- Throws:
WebAppConfigurationException
java.io.IOException
org.xml.sax.SAXException
GenericEntityException
-
buildFullUrl
public boolean buildFullUrl(java.lang.Appendable buffer, java.lang.String url, boolean useSSL) throws WebAppConfigurationException, java.io.IOException
Builds a full URL - including scheme, host, servlet path and resource.- Parameters:
buffer
-url
-useSSL
- Default value to use - will be replaced by request-map setting if one is found.- Returns:
true
if the URL uses https- Throws:
WebAppConfigurationException
java.io.IOException
-
buildHostPart
public boolean buildHostPart(java.lang.Appendable buffer, java.lang.String url, boolean useSSL) throws WebAppConfigurationException, java.io.IOException
Builds a partial URL - including the scheme and host, but not the servlet path or resource.- Parameters:
buffer
-url
-useSSL
- Default value to use - will be replaced by request-map setting if one is found with security=true set.- Returns:
true
if the URL uses https- Throws:
WebAppConfigurationException
java.io.IOException
-
buildPathPart
public void buildPathPart(java.lang.Appendable buffer, java.lang.String url) throws WebAppConfigurationException, java.io.IOException
Builds a partial URL - including the servlet path and resource, but not the scheme or host.- Parameters:
buffer
-url
-- Throws:
WebAppConfigurationException
java.io.IOException
-
-