Java Files.copy() not copying files

Viewed 2793

I've made this method that copies files from one absolute path (input directory) to another absolute path (output directory).

It doesn't give me any error, however no files are copied to the output folder.

Why would this be?

public static boolean copyFiles(String input, String output)
{
    File source = new File(input);
    File dest = new File(output);
    try {
        Files.copy(Paths.get(input), Paths.get(output), StandardCopyOption.REPLACE_EXISTING);
    } catch (Exception e) {
        e.printStackTrace();
        return false;
    }
    return true;
}
2 Answers

For my case, the Files are copied, just that it is not shown in the project explorer (in Eclipse) so just refresh it will do.

Related