public class StaticFileMapping extends Object
Used to define paths and locations of statically-served files such as images or HTML documents.
An example where this class is used is in the RestResource.staticFiles()
annotation:
Static files are found by using the ClasspathResourceFinder
defined on the resource.
In the example above, given a GET request to
RestContext.getMediaTypeForName(String)
method.
Constructor and Description |
---|
StaticFileMapping(Class<?> resourceClass,
String mappingString)
Constructor using a mapping string to represent a path/location pairing.
|
StaticFileMapping(Class<?> resourceClass,
String path,
String location,
Map<String,Object> responseHeaders)
Constructor.
|
public StaticFileMapping(Class<?> resourceClass, String path, String location, Map<String,Object> responseHeaders)
resourceClass
- The resource/servlet class which serves as the base location of the location below.path
- The mapped URI path.
location
- The location relative to the resource class.
responseHeaders
- The response headers.
Can be public StaticFileMapping(Class<?> resourceClass, String mappingString)
Mapping string must be one of these formats:
resourceClass
- The resource/servlet class which serves as the base location of the location below.mappingString
- The mapping string that represents the path/location mapping.
Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.