public class FileGetter extends FastRequestHandler
Destroyable.Util
DUMB, logger
Constructor and Description |
---|
FileGetter(File base) |
FileGetter(String base,
App app) |
Modifier and Type | Method and Description |
---|---|
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.
|
String |
toString() |
contentSecurityPolicy, csrfSpec, disableContentSecurityPolicy, prepareAuthentication, requireResolveContext, sessionFree
apply, corsSpec, destroy, isDestroyed, noContextResoving, realHandler, scope, setExpress, setSessionFree, wrap
public FileGetter(File base)
public boolean express(ActionContext context)
RequestHandler
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.
Note a handler that implements ExpressHandler
should always return true
for this method
express
in interface RequestHandler
express
in class RequestHandlerBase
context
- the action contexttrue
if this handler support direct io thread processingprotected void releaseResources()
releaseResources
in class RequestHandlerBase
public void handle(ActionContext context)
RequestHandler
Invoke handler upon an action context
context
- the context datapublic File base()
public boolean supportPartialPath()
RequestHandler
Indicate if this request handler support partial path lookup. Usually this method should return false
. However for certain request handler like FileGetter
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 RequestHandler
supportPartialPath
in class RequestHandlerBase
true
if the request handler support partial path lookup or false
otherwiseCopyright © 2014–2018 ActFramework. All rights reserved.