Advertisement
Guest User

check MIME type

a guest
Mar 1st, 2013
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.29 KB | None | 0 0
  1.     public boolean check(File fileCheck) {
  2.         try {
  3.             Path filePath = FileSystems.getDefault().getPath(
  4.                     fileCheck.getAbsolutePath());
  5.             if ((Files.probeContentType(filePath) == null)) {
  6.                 return false;
  7.             }
  8.         } catch (IOException e) {
  9.             e.printStackTrace();
  10.         }
  11.  
  12.         return true;
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement