Class WebServerInterceptor
java.lang.Object
com.predic8.membrane.core.interceptor.AbstractInterceptor
com.predic8.membrane.core.interceptor.server.WebServerInterceptor
- All Implemented Interfaces:
Interceptor
- Description
- Serves static files based on the request's path.
- Explanation
Note that docBase any location: A relative or absolute directory, a "classpath://com.predic8.membrane.core.interceptor.administration.docBase" expression or a URL.
The interceptor chain will not continue beyond this interceptor, as it either successfully returns a HTTP response with the contents of a file, or a "404 Not Found." error.
- Topic
- 4. Interceptors/Features
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.predic8.membrane.core.interceptor.Interceptor
Interceptor.Flow -
Field Summary
Fields inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
name, router -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ResponsecreateResponse(ResolverMap rr, String resPath) getIndex()handleRequest(Exchange exc) voidinit()Called after parsing is complete and this has been added to the object tree (whose root is Router).booleanvoidsetDocBase(String docBase) voidsetGenerateIndex(boolean generateIndex) voidMethods inherited from class com.predic8.membrane.core.interceptor.AbstractInterceptor
getDisplayName, getFlow, getHelpId, getLongDescription, getMessage, getRouter, getRule, handleAbort, handleResponse, init, setDisplayName, setFlow
-
Constructor Details
-
WebServerInterceptor
public WebServerInterceptor() -
WebServerInterceptor
-
-
Method Details
-
init
Description copied from class:AbstractInterceptorCalled after parsing is complete and this has been added to the object tree (whose root is Router).- Overrides:
initin classAbstractInterceptor- Throws:
Exception
-
handleRequest
- Specified by:
handleRequestin interfaceInterceptor- Overrides:
handleRequestin classAbstractInterceptor- Throws:
Exception
-
createResponse
- Throws:
IOException
-
getDocBase
-
setDocBase
- Default
- docBase
- Description
- Sets path to the directory that contains the web content.
- Example
- docBase
-
getIndex
-
setIndex
-
isGenerateIndex
public boolean isGenerateIndex() -
setGenerateIndex
public void setGenerateIndex(boolean generateIndex) -
getShortDescription
- Specified by:
getShortDescriptionin interfaceInterceptor- Overrides:
getShortDescriptionin classAbstractInterceptor
-