File file = File("C:\\Dossier_111\\fichier.txt");Il va afficher le chemin complet : "C:\\Dossier_111\\fichier.txt".
System.out.println("Chemin: " + file.getAbsolutePath());
File file = File("C:\\Dossier111\\fichier.txt");Exécution:
String absolutePath = file.getAbsolutePath();
String filePath = absolutePath.
substring(0,absolutePath.lastIndexOf(File.separator));
System.out.println("Chemin: " + filePath);
C:\\Dossier111
Please disable your ad blocker and refresh the window to use this website.