I need a method for checking the MIME-type file.
For this purpose, I used the probeContentType () method.
What are the alternatives for detecting MIME-type in files?
class ProbeContentTypeCheker implements Checker { @Override public boolean check(File currentFile) { try { Path filePath = FileSystems.getDefault().getPath( currentFile.getAbsolutePath()); if ((Files.probeContentType(filePath) != null)) { return true; } } catch (IOException e) { e.printStackTrace(); } return false; } }