@Response public class StaticFile extends Object
Constructor and Description |
---|
StaticFile(byte[] contents,
String mediaType,
Map<String,Object> headers)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
exists()
Does this file exist?
|
String |
getContentType()
Returns the content type for this static file.
|
Map<String,Object> |
getHeaders()
Get the HTTP response headers.
|
InputStream |
getInputStream()
Returns the contents of this static file as an input stream.
|
public StaticFile(byte[] contents, String mediaType, Map<String,Object> headers)
contents
- Contents of the file, or mediaType
- The media type of the file.headers
- Arbitrary response headers to set when sending this file as an HTTP response.public boolean exists()
@ResponseHeader(value="*") public Map<String,Object> getHeaders()
@ResponseBody public InputStream getInputStream() throws IOException
IOException
- Should never happen.@ResponseHeader(value="Content-Type") public String getContentType()
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.