Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static void copyFileFromJarToDirectory(String filename)
- {
- String DIR = getDataFolder();
- File outFile = new File(DIR + filename);
- if (!outFile.exists())
- {
- URL url = Main.class.getResource("/" + filename);
- System.out.println(url.getPath());
- try{
- File file = new File(url.toURI());
- outFile.getParentFile().mkdirs();
- outFile.createNewFile();
- FileUtils.copyFile(file, outFile);
- } catch (URISyntaxException e) {
- }
- catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement