Interface VirtualHostConfig
- All Superinterfaces:
- Config
 A Virtual Host is part of the configuration of a File Service within a Web Server. Values may not be
 changed once the server has been started.
- Since:
- 4.4
- 
Method SummaryModifier and TypeMethodDescriptionAdd a realm.Gets the alias file.getCache()Gets the cache configuration.intGets the compression threshold.Gets the document root.Gets the error page.Gets the home page.getHost()Gets the host.getName()Gets the virtual host name.Get a named realm.Gets the configured Realms.booleanisDebug()Is debug set?booleanisMinify()Is minify option set?booleanisStatic()Is static set?removeRealm(String name) Remove a named realm.voidsetAliasFile(String aliasFile) Sets the alias file.voidsetCompressionThreshold(int threshold) Sets the compression threshold.voidsetDebug(boolean debug) Sets debug option.voidsetErrorPage(String errorPage) Sets the error page.voidsetMinify(boolean minify) Sets minify option.voidsetStatic(boolean isStatic) Sets static option.
- 
Method Details- 
getNameString getName()Gets the virtual host name.- Returns:
- name
 
- 
getHostString getHost()Gets the host.- Returns:
- host
 
- 
getDocumentRootString getDocumentRoot()Gets the document root.- Returns:
- document root directory
 
- 
getHomePageString getHomePage()Gets the home page.- Returns:
- the home page
 
- 
setErrorPageSets the error page.This is used to control the 404 response. The server will look for one of this files in the directory of the request, if the file does not exist, it will look for this file in the virtual directory. If left blank or the file doesn't exist a standard 404 response HTML document will be sent. - Parameters:
- errorPage- the error page
- Throws:
- ConfigException- if unable to set property
 
- 
getErrorPageString getErrorPage()Gets the error page.- Returns:
- error page
 
- 
setStaticSets static option.If static set to true, after loading the resource once, the file system will not be checked again. This increases performance. Default is false. - Parameters:
- isStatic- true if static
- Throws:
- ConfigException- if unable to set property
 
- 
isStaticboolean isStatic()Is static set?- Returns:
- true if static option set
 
- 
setMinifySets minify option.Minify html. This will happen before the file is compressed. Default is false. - Parameters:
- minify- true to minify
- Throws:
- ConfigException- if unable to set property
 
- 
isMinifyboolean isMinify()Is minify option set?- Returns:
- true if minify set
 
- 
setCompressionThresholdSets the compression threshold.Enable compression for HTTP responses over this size. If not specified, 512 is assumed. - Parameters:
- threshold- in bytes
- Throws:
- ConfigException- if unable to set property
 
- 
getCompressionThresholdint getCompressionThreshold()Gets the compression threshold.- Returns:
- compression threshold in bytes
 
- 
setAliasFileSets the alias file.Optionally specifies a file to use for URL aliasing. - Parameters:
- aliasFile- the alias file name
- Throws:
- ConfigException- if unable to set property
 
- 
getAliasFileString getAliasFile()Gets the alias file.- Returns:
- alias file name or null if none set
 
- 
getCacheVirtualHostCacheConfig getCache()Gets the cache configuration.- Returns:
- cache configuration.
 
- 
getRealmsList<VirtualHostRealmConfig> getRealms()Gets the configured Realms.- Returns:
- list of realms
 
- 
getRealmGet a named realm.- Parameters:
- name- realm name
- Returns:
- the realm or null if not defined
 
- 
addRealmAdd a realm.- Parameters:
- name- realm name
- path- realm path
- Returns:
- realm configuration
- Throws:
- ConfigException- if unable to add a realm
 
- 
removeRealmRemove a named realm.- Parameters:
- name- realm name
- Returns:
- realm config or null if it did not exist
- Throws:
- ConfigException- if unable to remove
 
- 
setDebugSets debug option.Default is false. - Parameters:
- debug- true to set.
- Throws:
- ConfigException- if unable to set property
 
- 
isDebugboolean isDebug()Is debug set?- Returns:
- true if debug set
 
 
-