Package org.jini.rio.tools.webster
Class Webster
java.lang.Object
org.jini.rio.tools.webster.Webster
- All Implemented Interfaces:
Runnable
Webster is a HTTP server which can serve code from multiple codebases. Environment variables used
to control Webster are as follows:
| org.jini.rio.tools.webster.port | Sets the port for webster to use | 0 |
| org.jini.rio.tools.webster.restrictAccess | Restricts access only to files under root. Disallows any "../" notation. | true | org.jini.rio.tools.webster.root | Root directory to serve code from. Webster supports
multiple root directories which are separated by a ; |
System.getProperty(user.home) |
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleandeleteFile(File dir) protected String[]Get address that Webster is bound tointgetPort()Get the port Webster is bound togetRoots()Get the roots Webster is serving as a semicolon delimited StringgetURL()static voidprotected FileparseFileName(String filename) voidrun()voidTerminate a running Webster instance
-
Constructor Details
-
Webster
Create a new Webster. The port is determined by the org.jini.rio.tools.webster.port system property. If the org.jini.rio.tools.webster.port system property does not exist, an anonynous port will be allocated.- Throws:
BindException
-
Webster
Create a new Webster- Parameters:
port- The port to use- Throws:
BindException
-
Webster
Create a new Webster- Parameters:
roots- The root(s) to serve code from. This is a semi-colin delimited list of directories- Throws:
BindException
-
Webster
Create a new Webster- Parameters:
port- The port to useroots- The root(s) to serve code from. This is a semi-colin delimited list of directories- Throws:
BindException
-
Webster
Create a new Webster- Parameters:
port- The port to useroots- The root(s) to serve code from. This is a semi-colin delimited list of directoriesbindAddress- TCP/IP address which Webster should bind to (null implies no specific address)- Throws:
BindException
-
Webster
public Webster(int port, String roots, String bindAddress, int minThreads, int maxThreads) throws BindException Create a new Webster- Parameters:
port- The port to useroots- The root(s) to serve code from. This is a semi-colin delimited list of directoriesbindAddress- TCP/IP address which Webster should bind to (null implies no specific address)minThreads- Minimum threads to use in the ThreadPoolmaxThreads- Minimum threads to use in the ThreadPool- Throws:
BindException
-
Webster
Create a new Webster, compatible with the ServiceStarter mechanism in Jini 2.0- Parameters:
options- String[] of options. Valid options are [-port port], [-roots list-of-roots], [-bindAddress address], [-minThreads minThreads], [-maxThreads maxThreads] [-soTimeout soTimeout]lifeCycle- The LifeCycle object, may be null- Throws:
BindException
-
-
Method Details
-
getRoots
Get the roots Webster is serving as a semicolon delimited String -
getURL
-
getAddress
Get address that Webster is bound to- Returns:
- The host address the server socket Webster is using is bound to. If the socket is null, return null.
-
getHostName
-
getProtocol
-
terminate
public void terminate()Terminate a running Webster instance -
getPort
public int getPort()Get the port Webster is bound to -
run
public void run() -
parseFileName
-
expandRoots
-
main
- Throws:
IOException
-
deleteFile
-