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 Rest.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 path,
String location,
Map<String,Object> responseHeaders)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static List<StaticFileMapping> |
parse(Class<?> resourceClass,
String mapping)
Create one or more
|
ObjectMap |
toMap()
Returns the properties defined on this bean as a simple map for debugging purposes.
|
String |
toString() |
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 static List<StaticFileMapping> parse(Class<?> resourceClass, String mapping) throws ParseException
Mapping string must be one of these formats:
resourceClass
- The resource/servlet class which serves as the base location of the location below.mapping
- The mapping string that represents the path/location mapping.
ParseException
- If mapping was malformed.Copyright © 2016–2019 The Apache Software Foundation. All rights reserved.