Hello !
Je viens d'utiliser la nouvelle fonction de NIO.2 dans Java 7 pour déplacer un fichier :
1 2 3
| Path Source = Paths.get("D:\\1 - TEST\\Fichier.txt");
Path Destination = Paths.get("D:\\2 - TEST");
Files.move(Source, Destination, REPLACE_EXISTING, ATOMIC_MOVE); |
Mais le déplacement ne se fait pas
:
java.nio.file.AccessDeniedException: D:\1 - TEST\Fichier.txt -> D:\2 - TEST
AccessDeniedException ? Pourtant, les répertoires ne sont pas protéger en lecture ou en écriture... 
Note : j'ai pensé que le path de destination doit nécessairement être un fichier, mais cela ne marche pas plus :
1 2 3
| Path Destination = Paths.get("D:\\2 - TEST",Source.getFileName().toString());
java.nio.file.NoSuchFileException: D:\1 - TEST\Fichier.txt -> D:\2 - TEST\Fichier.txt |
Partager