public class WebAppUtils extends Object
Modifier and Type | Field and Description |
---|---|
static List<String> |
appBases |
static List<String> |
vhostNames |
Constructor and Description |
---|
WebAppUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
checkJaxApplication(WebApplication webApplication)
This util method is used to check if the given application is a Jax-RS/WS app
|
static String |
generateMetaFileDirName(String webappFilePath,
org.apache.axis2.context.ConfigurationContext configurationContext) |
static Map<String,WebApplicationsHolder> |
getAllWebappHolders(org.apache.axis2.context.ConfigurationContext configurationContext) |
static String |
getAppbase(String hostName)
This util method will return appbase value of matching host name from catalina-server.xml
|
static List<String> |
getAppBases() |
static String |
getDefaultHost() |
static WebApplicationsHolder |
getDefaultWebappHolder(org.apache.axis2.context.ConfigurationContext configurationContext) |
static org.apache.catalina.Host |
getHost(String webappFilePath) |
static String |
getMatchingHostName(String filePath) |
static org.apache.catalina.Host |
getMatchingVirtualHost(String baseDir) |
static String |
getServerConfigHostName()
This will read "HostName" value from carbon.xml and will return
default host (from catalina-server.xml) if the value is null (or not defined)
|
static List<String> |
getVhostNames() |
static String |
getWebappDir(String webappFilePath)
This util method is used to return base dir name of webapp.
|
static String |
getWebappDirPath(String webappFilePath)
This util method is used to return file path of base dir.
|
static WebApplicationsHolder |
getWebappHolder(String webappFilePath,
org.apache.axis2.context.ConfigurationContext configurationContext)
This util method will return the web application holder of the given web app file
|
static String |
getWebappKey(File webappFile)
This will return a key with pair hostname:webappFileName
|
static String |
getWebappName(String webappFilePath) |
static String |
getWebappResourcePath(WebApplication webApplication)
Returns the registry path for the webapp
|
static boolean |
isWebappUploadedToVirtualAppBase(String webAppBaseDir,
String appBase) |
static boolean |
validateWebappFileName(String filename) |
public static String checkJaxApplication(WebApplication webApplication)
webApplication
- application objectpublic static boolean validateWebappFileName(String filename)
public static String getWebappDirPath(String webappFilePath)
webappFilePath
- path to webapppublic static String getMatchingHostName(String filePath)
filePath
- web app base dir pathpublic static org.apache.catalina.Host getMatchingVirtualHost(String baseDir)
baseDir
- web application directory pathpublic static boolean isWebappUploadedToVirtualAppBase(String webAppBaseDir, String appBase)
webAppBaseDir
- path to the webappappBase
- virtual host pathpublic static org.apache.catalina.Host getHost(String webappFilePath) throws org.wso2.carbon.tomcat.CarbonTomcatException
webappFilePath
- Webapp pathorg.wso2.carbon.tomcat.CarbonTomcatException
public static String getWebappKey(File webappFile)
webappFile
- web application filepublic static String getAppbase(String hostName)
hostName
- hostname of Host elementpublic static Map<String,WebApplicationsHolder> getAllWebappHolders(org.apache.axis2.context.ConfigurationContext configurationContext)
configurationContext
- ConfigurationContext instancepublic static WebApplicationsHolder getWebappHolder(String webappFilePath, org.apache.axis2.context.ConfigurationContext configurationContext)
webappFilePath
- AbsolutePath of webappconfigurationContext
- ConfigurationContext instancepublic static String getWebappDir(String webappFilePath)
webappFilePath
- path to web apppublic static String getWebappName(String webappFilePath)
webappFilePath
- path to webapppublic static WebApplicationsHolder getDefaultWebappHolder(org.apache.axis2.context.ConfigurationContext configurationContext)
public static String getDefaultHost()
public static String getServerConfigHostName()
public static String generateMetaFileDirName(String webappFilePath, org.apache.axis2.context.ConfigurationContext configurationContext)
public static String getWebappResourcePath(WebApplication webApplication)
webApplication
- WebApplication instanceCopyright © 2018 WSO2. All rights reserved.