How do i copy a directory from a jar to another directory

edited March 2019 in Questions about Code

Hi I have a folder inside my jar that I want it to be copied to the user's documents folder. I tried several methods and they don't seem to work.

This is my current code:

File dest = new File(System.getProperty("user.home") + "\\alchemy\\resources");
        File source = new File("src\\vansius\\alchemy\\resources");
        try {
            FileUtils.copyDirectory(source, dest);
        } catch (IOException e) {
            e.printStackTrace();
        }

No error message is shown but the directory is not copied

Sign In or Register to comment.