public class AssetsWebsite extends BasicWebsite implements Patterns
| Modifier and Type | Class and Description |
|---|---|
static class |
AssetsWebsite.AssetsReader |
DEFAULT_INDEXFORWARD, PAIR_KEY, PAIR_KEY_VALUE, PAIR_NO_KEY, PAIR_NO_VALUE, PAIR_VALUE, PATH, PATH_0, PATH_1, REDIRECT, WORD| Constructor and Description |
|---|
AssetsWebsite(android.content.Context context,
java.lang.String rootPath)
Create a website object.
|
AssetsWebsite(android.content.Context context,
java.lang.String rootPath,
java.lang.String indexFileName)
Create a website object.
|
| Modifier and Type | Method and Description |
|---|---|
ResponseBody |
getBody(HttpRequest request,
HttpResponse response) |
java.lang.String |
getETag(HttpRequest request)
Get the
ETag requesting the specified resource. |
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. |
boolean |
intercept(HttpRequest request)
Whether to intercept the current request.
|
addEndSlash, addStartSlash, getIndexFileName, queryString, trimEndSlash, trimSlash, trimStartSlashgetHandlerpublic AssetsWebsite(android.content.Context context,
java.lang.String rootPath)
rootPath - website root directory.public AssetsWebsite(android.content.Context context,
java.lang.String rootPath,
java.lang.String indexFileName)
rootPath - website root directory.indexFileName - the default file name for each directory, e.g. index.html.public boolean intercept(HttpRequest request)
HandlerAdapterintercept in interface HandlerAdapterrequest - current request.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.
getETag in interface ETaggetETag in class BasicWebsitejava.lang.Throwablepublic 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 BasicWebsiterequest - current requestjava.lang.Throwablepublic ResponseBody getBody(HttpRequest request, HttpResponse response) throws java.io.IOException