public static void cloneFileFromJar(String jarPath, String fileToMove, String pathTo) throws IOException {
        notNull(jarPath, "String jarPath");
        notNull(fileToMove, "String fileToMove");
        notNull(pathTo, "String pathTo");
        notEmpty(jarPath, "String jarPath");
        notEmpty(fileToMove, "String fileToMove");
        notEmpty(pathTo, "String pathTo");

        JarFile jar = null;
        FileOutputStream out = null;
        IOException exThrown = null;
        try {
            jar = new JarFile(jarPath);
            JarEntry entry = jar.getJarEntry(fileToMove);

            InputStream in = jar.getInputStream(entry);
            out = new FileOutputStream(pathTo);
            ReadableByteChannel rbc = Channels.newChannel(in);
            out.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
        }
        catch (IOException ioex) {
            exThrown = ioex;
        }
        finally {
            try {
                if (out != null) {
                    out.close();
                }
                if (jar != null) {
                    jar.close();
                }
            }
            catch (IOException e) {
                // IGNORED
            }
        }
        if (exThrown != null) {
            throw exThrown;
        }
    }