public interface VirtualHostConfig extends 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.
Modifier and Type | Method and Description |
---|---|
VirtualHostRealmConfig |
addRealm(String name,
String path)
Add a realm.
|
String |
getAliasFile()
Gets the alias file.
|
VirtualHostCacheConfig |
getCache()
Gets the cache configuration.
|
int |
getCompressionThreshold()
Gets the compression threshold.
|
String |
getDocumentRoot()
Gets the document root.
|
String |
getErrorPage()
Gets the error page.
|
String |
getHomePage()
Gets the home page.
|
String |
getHost()
Gets the host.
|
String |
getName()
Gets the virtual host name.
|
VirtualHostRealmConfig |
getRealm(String name)
Get a named realm.
|
List<VirtualHostRealmConfig> |
getRealms()
Gets the configured Realms.
|
boolean |
isDebug()
Is debug set?
|
boolean |
isMinify()
Is minify option set?
|
boolean |
isStatic()
Is static set?
|
VirtualHostRealmConfig |
removeRealm(String name)
Remove a named realm.
|
void |
setAliasFile(String aliasFile)
Sets the alias file.
|
void |
setCompressionThreshold(int threshold)
Sets the compression threshold.
|
void |
setDebug(boolean debug)
Sets debug option.
|
void |
setErrorPage(String errorPage)
Sets the error page.
|
void |
setMinify(boolean minify)
Sets minify option.
|
void |
setStatic(boolean isStatic)
Sets static option.
|
String getName()
String getHost()
String getDocumentRoot()
String getHomePage()
void setErrorPage(String errorPage) throws ConfigException
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.
errorPage
- the error pageConfigException
- if unable to set propertyString getErrorPage()
void setStatic(boolean isStatic) throws ConfigException
If static set to true, after loading the resource once, the file system will not be checked again. This increases performance.
Default is false.
isStatic
- true if staticConfigException
- if unable to set propertyboolean isStatic()
void setMinify(boolean minify) throws ConfigException
Minify html. This will happen before the file is compressed.
Default is false.
minify
- true to minifyConfigException
- if unable to set propertyboolean isMinify()
void setCompressionThreshold(int threshold) throws ConfigException
Enable compression for HTTP responses over this size.
If not specified, 512 is assumed.
threshold
- in bytesConfigException
- if unable to set propertyint getCompressionThreshold()
void setAliasFile(String aliasFile) throws ConfigException
Optionally specifies a file to use for URL aliasing.
aliasFile
- the alias file nameConfigException
- if unable to set propertyString getAliasFile()
VirtualHostCacheConfig getCache()
List<VirtualHostRealmConfig> getRealms()
VirtualHostRealmConfig getRealm(String name)
name
- realm nameVirtualHostRealmConfig addRealm(String name, String path) throws ConfigException
name
- realm namepath
- realm pathConfigException
- if unable to add a realmVirtualHostRealmConfig removeRealm(String name) throws ConfigException
name
- realm nameConfigException
- if unable to removevoid setDebug(boolean debug) throws ConfigException
Default is false.
debug
- true to set.ConfigException
- if unable to set propertyboolean isDebug()
Copyright © 2021 Push Technology Ltd. All Rights Reserved.