|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.lang.Thread | +--uk.org.iscream.cms.corbaservices.MiniWebServer
MiniWebServer This provides a very basic webserver for serving IOR files. This could easily serve other text files, but not binaries.
Nested Class Summary | |
private class |
MiniWebServer.Handler
A Handler to deal with each client. |
Field Summary | |
private LinkedList |
_okUrls
List of URLs that are permitted |
private String |
_okUrlsConfig
Config file for the URL list |
private long |
_okUrlsConfigStamp
Timestamp of the URL config file |
private int |
_port
The port we're bound to. |
private String |
_webDir
Web directory |
static String |
REVISION
The current CVS revision of this class |
Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
MiniWebServer(int port,
String okUrlsConfig,
String webDir)
Construct a new MiniWebServer |
Method Summary | |
private boolean |
okUrl(String url)
Checks if an URL is allowed. |
private void |
readOkUrls()
Reads the list of URLs into a list. |
private String |
readUrl(String url)
Reads a file in given an URL. |
void |
run()
Main thread of execution. |
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String REVISION
private int _port
private LinkedList _okUrls
private String _okUrlsConfig
private long _okUrlsConfigStamp
private String _webDir
Constructor Detail |
public MiniWebServer(int port, String okUrlsConfig, String webDir)
port
- The port to bind tookUrlsConfig
- The URL list config filewebDir
- The web directoryMethod Detail |
public void run()
run
in interface Runnable
run
in class Thread
private String readUrl(String url)
url
- The URL given to the webserver
private boolean okUrl(String url)
url
- the url to check
private void readOkUrls()
|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |