File file = File("C:\\Dossier_111\\fichier.txt");Он отобразит полный путь: "C:\\Dossier_111\\fichier.txt".
System.out.println("Путь: " + file.getAbsolutePath());
File file = File("C:\\ Файл111\\fichier.txt");Runtime:
String absolutePath = file.getAbsolutePath();
String filePath = absolutePath.
substring(0,absolutePath.lastIndexOf(File.separator));
System.out.println("Путь: " + filePath);
C:\\Folder111
Please disable your ad blocker and refresh the window to use this website.