public class FileExtensionHttpFileDescriber extends Object implements HttpFileDescriber
HttpFileDescriber
that maps the file extension to the description
details.Modifier and Type | Field and Description |
---|---|
static String |
CHARSET_PREFIX
Prefix on
Properties name to obtain the Charset . |
static String |
CONTENT_ENCODING_PREFIX
Prefix on
Properties name to obtain the
Content-Encoding details. |
static String |
CONTENT_TYPE_PREFIX
Prefix on
Properties name to obtain the Content-Type
details. |
Constructor and Description |
---|
FileExtensionHttpFileDescriber() |
Modifier and Type | Method and Description |
---|---|
boolean |
describe(HttpFileDescription description)
Describes the
HttpFileDescription . |
void |
loadDefaultDescriptions()
Loads the default file extension descriptions.
|
void |
loadDescriptions(Properties properties)
Loads the descriptions from the
Properties . |
void |
mapContentEncoding(String fileExtension,
String contentEncoding)
Maps the
Content-Encoding for the file extension. |
void |
mapContentType(String fileExtension,
String contentType,
Charset charset)
Maps the
Content-Type for the file extension. |
public static final String CONTENT_ENCODING_PREFIX
Properties
name to obtain the
Content-Encoding
details.public static final String CONTENT_TYPE_PREFIX
Properties
name to obtain the Content-Type
details.public static final String CHARSET_PREFIX
Properties
name to obtain the Charset
.public void loadDefaultDescriptions()
public void loadDescriptions(Properties properties)
Properties
.properties
- Properties
.public void mapContentEncoding(String fileExtension, String contentEncoding)
Content-Encoding
for the file extension.fileExtension
- File extension.contentEncoding
- Content-Encoding
.public void mapContentType(String fileExtension, String contentType, Charset charset)
Content-Type
for the file extension.fileExtension
- File extension.contentType
- Content-Encoding
.charset
- Charset
.public boolean describe(HttpFileDescription description)
HttpFileDescriber
HttpFileDescription
.describe
in interface HttpFileDescriber
description
- HttpFileDescription
.true
should the HttpFile
be described.
false
indicates unable to describe and should use
alternate HttpFileDescriber
.Copyright © 2005–2016. All rights reserved.