public class FileSystemUtils extends Object
| Constructor and Description |
|---|
FileSystemUtils() |
| Modifier and Type | Method and Description |
|---|---|
Charset |
detectFileEncoding(File file)
Tries to predict encoding of a file.
|
Charset |
detectFileEncoding(File file,
FileParametersDetector detector)
Tries to predict encoding of a file.
|
String |
detectFileMimeType(File file)
Tries to predict MIME type of file.
|
String |
detectFileMimeType(File file,
FileParametersDetector detector)
Tries to predict MIME type of file.
|
public Charset detectFileEncoding(File file)
public Charset detectFileEncoding(File file, FileParametersDetector detector)
file - a file for predictiondetector - an implementation of FileParametersDetector class.
If null, it'll use DefaultFileParametersDetectorCharset class is the corresponding encoding of the file.
If the detector cannot define an encoding, then it returns the system default encoding.public String detectFileMimeType(File file, FileParametersDetector detector)
file - a file for predictiondetector - an implementation of FileParametersDetector class.
If null, it'll use DefaultFileParametersDetectorProtocolUtils.DEFAULT_BINARY_CONTENT_TYPE)Copyright © 2023. All rights reserved.