Class ClasspathAssetRequestHandler
java.lang.Object
org.apache.tapestry5.internal.services.assets.ClasspathAssetRequestHandler
- All Implemented Interfaces:
AssetRequestHandler
A handler for asset requests for classpath assets (within a specific folder).
Each mapping of the
ClasspathAssetAliasManager gets one of these.- Since:
- 5.2.0
-
Constructor Summary
ConstructorsConstructorDescriptionClasspathAssetRequestHandler(ResourceStreamer streamer, AssetSource assetSource, String baseFolder, ClasspathAssetProtectionRule classpathAssetProtectionRule) -
Method Summary
Modifier and TypeMethodDescriptionbooleanhandleAssetRequest(Request request, Response response, String extraPath) Given a request targeted (via the handler id) to the specific handler, process the request.
-
Constructor Details
-
ClasspathAssetRequestHandler
public ClasspathAssetRequestHandler(ResourceStreamer streamer, AssetSource assetSource, String baseFolder, ClasspathAssetProtectionRule classpathAssetProtectionRule)
-
-
Method Details
-
handleAssetRequest
public boolean handleAssetRequest(Request request, Response response, String extraPath) throws IOException Description copied from interface:AssetRequestHandlerGiven a request targeted (via the handler id) to the specific handler, process the request. The handler is responsible for processing the request, sending back either a bytestream (viaResponse.getOutputStream(String)) or an error response (viaResponse.sendError(int, String)). It is the handler's responsibility to allow for client-side caching (possibly sending anHttpServletResponse.SC_NOT_MODIFIEDresponse). The handler should return true if it provided a response. If the handler returns false, this indicates that the extra path did not identify a known asset (virtual or otherwise) and the AssetDispatcher service should send aHttpServletResponse.SC_NOT_FOUNDresponse. Starting in Tapestry 5.4, the handler is informed by theAssetRequestDispatcherwhether or not the content should be compressed (this is determined based on information in the URL).- Specified by:
handleAssetRequestin interfaceAssetRequestHandler- Parameters:
request- incoming asset requestresponse- used to send a response to clientextraPath- additional path to identify the specific asset- Returns:
- true if request was handled (and response sent), false if asset not found
- Throws:
IOException
-