I’m trying to “rename” a folder with my application copying the source folder to another.
But… When I create the destination folder, the files inside it are empty (0 bytes).
Notice that this happens only on the linux machine where I deploy the app.
Doesn’t happens on my local machine with windows.
I’ve tried
Files.copy(src, dest);
and creating the byte array with input/output streams
byte[] buffer = new byte[1024];
Same result.
Any ideas?
I am not sure why this problem occurs on the Linux machine, what VM and Version is running on the Linux machine?
You might want to try apache commons-io FileUtils it has copyDirectory methods, makes live much easier.
http://commons.apache.org/io/api-release/org/apache/commons/io/FileUtils.html