Interface FileServiceConfig
- All Superinterfaces:
Config
Web Server - File Service Configuration.
This is an optional object for a Web Server, that is a Web Server may or may not have a file service configured.
No values can be changed after the server has been started.
- Since:
- 4.4
-
Method Summary
Modifier and TypeMethodDescriptionaddVirtualHost
(String name, String host, String documentRoot, String homePage) Add a new virtual host configuration.getName()
Gets the file service name.getVirtualHost
(String name) Get a named virtual host configuration.Get Virtual Hosts configured.long
Gets the write timeout value.removeVirtualHost
(String name) Remove virtual host.void
setWriteTimeout
(long timeout) Sets the write timeout.
-
Method Details
-
getName
String getName()Gets the file service name.- Returns:
- file service name
-
getVirtualHosts
List<VirtualHostConfig> getVirtualHosts()Get Virtual Hosts configured.- Returns:
- list of virtual hosts which can be empty if none configured.
-
getVirtualHost
Get a named virtual host configuration.- Parameters:
name
- the virtual host name- Returns:
- the configuration or null if none exists for name
-
addVirtualHost
VirtualHostConfig addVirtualHost(String name, String host, String documentRoot, String homePage) throws ConfigException Add a new virtual host configuration.- Parameters:
name
- virtual host namehost
- Specify the host of which the virtual host is to serve, i.e. download.pushtechnology.com or * for alldocumentRoot
- This is the physical directory for this virtual hosthomePage
- This sets the default home page which is used with directory browsing.- Returns:
- virtual host configuration
- Throws:
ConfigException
- if unable to ad virtual host
-
removeVirtualHost
Remove virtual host.- Parameters:
name
- the name of the host to remove- Returns:
- the host or null if it did not exist
- Throws:
ConfigException
- if unable to remove
-
setWriteTimeout
Sets the write timeout.Write timeout for serving files. This does not affect HTTP clients.
If not explicitly specified, 3 seconds is assumed.
- Parameters:
timeout
- in milliseconds- Throws:
ConfigException
- if unable to set write timeout
-
getWriteTimeout
long getWriteTimeout()Gets the write timeout value.- Returns:
- write timeout
-