public abstract class BasicWebsite extends Website
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_INDEX |
| Constructor and Description |
|---|
BasicWebsite() |
BasicWebsite(java.lang.String indexFileName)
Create a website object.
|
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
addEndSlash(java.lang.String target)
Add '/' at the ending.
|
protected java.lang.String |
addStartSlash(java.lang.String target)
Add the '/' to the beginning.
|
java.lang.String |
getETag(HttpRequest request)
Get the
ETag requesting the specified resource. |
protected java.lang.String |
getIndexFileName()
Get the name of the indexFile.
|
long |
getLastModified(HttpRequest request)
The return value will be sent to the HTTP client as
Last-Modified header, and compared with If-Modified-Since headers that the client sends back. |
protected java.lang.String |
queryString(HttpRequest request) |
protected java.lang.String |
trimEndSlash(java.lang.String target)
Remove '/' at the ending.
|
protected java.lang.String |
trimSlash(java.lang.String target)
Remove the '/' at the beginning and ending.
|
protected java.lang.String |
trimStartSlash(java.lang.String target)
Remove '/' at the beginning.
|
getBody, getHandlerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinterceptpublic static final java.lang.String DEFAULT_INDEX
public BasicWebsite()
public BasicWebsite(java.lang.String indexFileName)
indexFileName - the default file name for each directory, e.g. index.html.public java.lang.String getETag(HttpRequest request) throws java.lang.Throwable
ETagETag requesting the specified resource.
Can simply return null if there's no support.
public long getLastModified(HttpRequest request) throws java.lang.Throwable
LastModifiedLast-Modified header, and compared with If-Modified-Since headers that the client sends back. The content will only get regenerated if there has been a
modification.getLastModified in interface LastModifiedgetLastModified in class Websiterequest - current requestjava.lang.Throwableprotected final java.lang.String getIndexFileName()
protected java.lang.String addStartSlash(java.lang.String target)
target - target string.protected java.lang.String addEndSlash(java.lang.String target)
target - target string.protected java.lang.String trimStartSlash(java.lang.String target)
target - target string.protected java.lang.String trimEndSlash(java.lang.String target)
target - target string.protected java.lang.String trimSlash(java.lang.String target)
target - target string.protected java.lang.String queryString(HttpRequest request)