×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Massimo Zappino
Added: Oct 4, 2017 12:27 PM
Views: 4
Tags: file mime-type
  1. File file = new File("/tmp/file.txt");
  2. Path source = Paths.get(file.getPath());
  3. String mimeType = Files.probeContentType(source);