fork download
  1. import java.io.IOException;
  2. import java.nio.file.Files;
  3. import java.nio.file.Path;
  4. import java.nio.file.Paths;
  5.  
  6. class Ideone {
  7. public static void main(String[] args) throws IOException {
  8. Path source = Paths.get("‪D/Music/Hamari_Adhuri_Kahani_(Title_Song)(wapking.cc).mp3");
  9. System.out.println(Files.probeContentType(source));
  10. // output : image/tiff
  11. }
  12. }
Runtime error #stdin #stdout #stderr 0.1s 320448KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Exception in thread "main" java.nio.file.InvalidPathException: Malformed input or input contains unmappable characters: ‪D/Music/Hamari_Adhuri_Kahani_(Title_Song)(wapking.cc).mp3
	at sun.nio.fs.UnixPath.encode(UnixPath.java:147)
	at sun.nio.fs.UnixPath.<init>(UnixPath.java:71)
	at sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:281)
	at java.nio.file.Paths.get(Paths.java:84)
	at Ideone.main(Main.java:8)