| Modifier and Type | Field and Description |
|---|---|
| private volatile boolean | |
| private Map | |
| private final Path |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected String | implProbeContentType(Path path)
Implements abstract sun. Probes the given file to guess its content type. |
| private void | |
| private void | |
| private void |
| loaded | back to summary |
|---|---|
| private volatile boolean loaded | |
| mimeTypeMap | back to summary |
|---|---|
| private Map<String, String> mimeTypeMap | |
| mimeTypesFile | back to summary |
|---|---|
| private final Path mimeTypesFile | |
| MimeTypesFileTypeDetector | back to summary |
|---|---|
| public MimeTypesFileTypeDetector(Path filePath) | |
| implProbeContentType | back to summary |
|---|---|
| protected String implProbeContentType(Path path) Implements abstract sun. Doc from sun. Probes the given file to guess its content type.
| |
| loadMimeTypes | back to summary |
|---|---|
| private void loadMimeTypes() Parse the mime types file, and store the type-extension mappings into mimeTypeMap. The mime types file is not loaded until the first probe to achieve the lazy initialization. It adopts double-checked locking optimization to reduce the locking overhead. | |
| parseMimeEntry | back to summary |
|---|---|
| private void parseMimeEntry(String entry) Parse a mime-types entry, which can have the following formats. 1) Simple space-delimited format image/jpeg jpeg jpg jpe JPG 2) Netscape key-value pair format type=application/x-java-jnlp-file desc="Java Web Start" exts="jnlp" or type=text/html exts=htm,html | |
| putIfAbsent | back to summary |
|---|---|
| private void putIfAbsent(String key, String value) | |