Here you can find the source of loadFolderFromJar(String path)
public static void loadFolderFromJar(String path) throws Exception
//package com.java2s; import java.io.*; public class Main { public static void loadFolderFromJar(String path) throws Exception { InputStream in = null;/*from w w w. j a va 2s . c o m*/ FileOutputStream fos = null; try { File dir = new File(path); for (File nextFile : dir.listFiles()) { in = new FileInputStream(nextFile.toString()); File temp = new File("cdatafiles" + File.separator + nextFile.getName()); temp.getParentFile().mkdirs(); temp.createNewFile(); fos = new FileOutputStream(temp); byte[] buffer = new byte[1024]; int read = -1; while ((read = in.read(buffer)) != -1) fos.write(buffer, 0, read); } } catch (Exception e) { e.printStackTrace(); } finally { if (fos != null) fos.close(); if (in != null) in.close(); } } }