I'm writing a Java program, and I need to copy a directory that's inside a JAR file. What I want to do is when a user double clicks on the JAR file, it copies the folder inside the JAR to another directory on the user's computer and then works with the directory. I've tried answers from this question to no avail. I'm using Java 8, by the way.
Asked
Active
Viewed 89 times
0
-
2In the past, when I've needed to do this, I've; A) created a "file list" (manifest) text file at build time, which contains the names of all the files in the target directory. From this, you can then simply use `Class#getResourceAsStream` to get `InputStream` of each file in the jar in turn. B) Compressed the files (in the directory) into a Zip file, include it in the jar and (at build time) then, at runtime, extract this file (to a temporary location) and unzip it's contents – MadProgrammer Oct 03 '22 at 00:50