public abstract class DesugarAbstractFileTypeDetector extends FileTypeDetector
| Modifier | Constructor and Description |
|---|---|
protected |
DesugarAbstractFileTypeDetector() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getExtension(String name)
Returns the extension of a file name, specifically the portion of the
parameter string after the first dot.
|
protected abstract String |
implProbeContentType(Path file)
Probes the given file to guess its content type.
|
String |
probeContentType(Path file)
Invokes the appropriate probe method to guess a file's content type,
and checks that the content type's syntax is valid.
|
protected final String getExtension(String name)
null,
empty, does not contain a dot, or the dot is the last character, then an
empty string is returned, otherwise the characters after the dot are
returned.name - A file namepublic final String probeContentType(Path file) throws IOException
probeContentType in class FileTypeDetectorfile - the path to the file to probenull if the file type is not
recognizedIOException - An I/O error occursFiles.probeContentType(java.nio.file.Path)protected abstract String implProbeContentType(Path file) throws IOException
IOException