public class StaticFileGetter extends FastRequestHandler
Destroyable.UtilDUMB, logger| Constructor and Description |
|---|
StaticFileGetter(java.io.File base) |
StaticFileGetter(java.lang.String base,
App app) |
| Modifier and Type | Method and Description |
|---|---|
java.io.File |
base() |
boolean |
express(ActionContext context)
Indicate the handler logic is fast enough to be put into network layer’s io thread and does not require to dispatch to worker thread.
|
void |
handle(ActionContext context)
Invoke handler upon an action context
|
protected void |
releaseResources() |
boolean |
supportPartialPath()
Indicate if this request handler support partial path lookup.
|
java.lang.String |
toString() |
csrfSpec, prepareAuthentication, requireResolveContext, sessionFreeapply, corsSpec, destroy, isDestroyed, noContextResoving, realHandler, scope, setExpress, setSessionFree, wrappublic StaticFileGetter(java.lang.String base,
App app)
public StaticFileGetter(java.io.File base)
public boolean express(ActionContext context)
RequestHandlerIndicate the handler logic is fast enough to be put into network layer’s io thread and does not require to dispatch to worker thread.
Note a handler that implements ExpressHandler should always return true for this method
express in interface RequestHandlerexpress in class RequestHandlerBasecontext - the action contexttrue if this handler support direct io thread processingprotected void releaseResources()
releaseResources in class RequestHandlerBasepublic void handle(ActionContext context)
RequestHandlerInvoke handler upon an action context
context - the context datapublic java.io.File base()
public boolean supportPartialPath()
RequestHandlerIndicate if this request handler support partial path lookup. Usually this method should return false. However for certain request handler like StaticFileGetter they need to support partial path lookup. Take the example of the following route mapping:
GET /public staticDir: /public which map url path /public to a StaticFileGetter with base dir set to /public, it needs to support all path starts with “/public”, like “/public/js/jquery.js” etc.supportPartialPath in interface RequestHandlersupportPartialPath in class RequestHandlerBasetrue if the request handler support partial path lookup or false otherwisepublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014–2017 ActFramework. All rights reserved.