public final class AppPathService extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
SESSION_BASE_URL |
| Modifier and Type | Method and Description |
|---|---|
static UrlItem |
buildRedirectUrlItem(String strRootUrl,
String strUrlPropertySuffixKey)
Build the url item to use for a url that includes the redirection parameter
for reconnection.
|
static String |
getAbsolutePathFromRelativePath(String strDirectory)
Returns the absolute path of a repository from a relative path
|
static String |
getAbsoluteUrl(javax.servlet.http.HttpServletRequest request,
String strUrl)
Returns the absolute url corresponding to the given one, if the later was
found to be relative.
|
static String |
getAdminMenuUrl()
Returns the admin menu page relative url (jsp/admin/site/AdminMenu.jsp)
defined in lutece.properties
|
static String |
getAdminPortalUrl()
Returns the admin portal page relative url (jsp/admin/site/AdminSite.jsp)
defined in lutece.properties
|
static ReferenceList |
getAvailableVirtualHosts()
Gets available virtual hosts defined in the config.properties
|
static String |
getBaseUrl()
Deprecated.
Use
getBaseUrl(HttpServletRequest) instead |
static String |
getBaseUrl(javax.servlet.http.HttpServletRequest request)
Return the url of the webapp, built from the request
|
static String |
getPath(String strKey)
Returns the absolute path of a repository from a relative definition in
properties file
|
static String |
getPath(String strKey,
String strFilename)
Returns the absolute path of file from its relative definition in properties
file.
|
static String |
getPortalUrl()
Returns the portal page relative url (jsp/site/Portal.jsp) defined in
lutece.properties
|
static String |
getProdUrl(javax.servlet.http.HttpServletRequest request)
Return the webapp prod url (or the base url if no prod url has been
definied).
|
static String |
getProdUrl(String strBaseUrl)
Return the webapp prod url.
|
static FileInputStream |
getResourceAsStream(String strPath,
String strFilename)
Gets a file as stream
|
static String |
getRootForwardUrl()
Returns the forward URL for webapp's root path.
|
static String |
getSiteMessageUrl()
Returns the Site Message relative url (jsp/site/SiteMessage.jsp) defined in
lutece.properties
|
static String |
getSiteMessageUrl(javax.servlet.http.HttpServletRequest request)
Return the url of the webapp, built from the request
|
static String |
getVirtualHostKey(javax.servlet.http.HttpServletRequest request)
Gets a Virtual Host Key if the request contains a virtual host key
|
static String |
getWebappInstance()
Gets the webapp instance defined in the config.properties file with the key
lutece.webapp.instance
|
static String |
getWebAppPath()
Returns the webapp path from the properties file
|
static void |
init(javax.servlet.ServletContext context)
Initialize The path service
|
static void |
init(String strWebAppPath)
Initialize The webapppath
|
static boolean |
isDefaultWebappInstance()
Returns whether the current instance is the default webapp instance
|
static UrlItem |
resolveRedirectUrl(javax.servlet.http.HttpServletRequest request,
String strDefaultRedirectUrl)
Retrieve the url to redirect to after login.
|
public static final String SESSION_BASE_URL
public static void init(javax.servlet.ServletContext context)
context - The servlet contextpublic static void init(String strWebAppPath)
strWebAppPath - The Webapp pathpublic static String getPath(String strKey)
strKey - the repository key definied in properties filepublic static String getWebAppPath()
public static String getPath(String strKey, String strFilename)
strKey - the repository key defined in properties filestrFilename - The name of filepublic static FileInputStream getResourceAsStream(String strPath, String strFilename)
strPath - the pathstrFilename - The name of filepublic static String getAbsolutePathFromRelativePath(String strDirectory)
strDirectory - the relative pathpublic static String getBaseUrl(javax.servlet.http.HttpServletRequest request)
request - The HttpServletRequest@Deprecated public static String getBaseUrl()
getBaseUrl(HttpServletRequest) insteadgetBaseUrl(HttpServletRequest) instead.public static String getProdUrl(javax.servlet.http.HttpServletRequest request)
request - The HTTP requestpublic static String getProdUrl(String strBaseUrl)
strBaseUrl - The base URLpublic static String getSiteMessageUrl(javax.servlet.http.HttpServletRequest request)
request - The HttpServletRequestpublic static String getPortalUrl()
public static String getRootForwardUrl()
public static String getSiteMessageUrl()
public static String getAdminPortalUrl()
public static String getAdminMenuUrl()
public static ReferenceList getAvailableVirtualHosts()
public static String getVirtualHostKey(javax.servlet.http.HttpServletRequest request)
request - The HTTP requestpublic static UrlItem buildRedirectUrlItem(String strRootUrl, String strUrlPropertySuffixKey)
strRootUrl - the root part of the url, to build an absolute
urlstrUrlPropertySuffixKey - The property suffix to retrieve the urlpublic static UrlItem resolveRedirectUrl(javax.servlet.http.HttpServletRequest request, String strDefaultRedirectUrl)
request - the http requeststrDefaultRedirectUrl - the default url to go to after loginpublic static String getAbsoluteUrl(javax.servlet.http.HttpServletRequest request, String strUrl)
request - the http request (provides the base path if needed)strUrl - the url to transformpublic static String getWebappInstance()
public static boolean isDefaultWebappInstance()
Copyright © 2020 City of Paris. All rights reserved.