code: public static void extractFile(JarFile jar, JarEntry entry, File destPath) throws IOException {
  		InputStream in = null;
  		OutputStream out = null;
  		
  		try {
  			in = jar.getInputStream(entry);
  			out = new FileOutputStream(destPath);
  			byte[] buf = new byte[1024];
  	        for (int i = in.read(buf); i != -1; i = in.read(buf))
  	        {
  	           out.write(buf, 0, i);
  	        }
  		} finally {
  			if(in != null) {
  				in.close();
  			}
  			if(out != null) {
  				out.close();
  			}
  		}
  
  		//Ensure persmissions are set correct on ascp, has to be done after the File has been created
  		if (entry.getName().equals("ascp")) {
  			destPath.setExecutable(true);
  			destPath.setWritable(true);
  		}
  	}
docs: Extracts a jar entry from a jar file to a target location on the local file system
  @param jar The jar in which the desired file resides
  @param entry The desired entry (file) to extract from the jar
  @param destPath The target location to extract the jar entry to
  @throws IOException if any IO failure occurs during file extraction