private static List<String> getResourcesFromJar(File file, String path, boolean directories) throws IOException {

        List<String> resources = new ArrayList<String>();

        ZipFile zipFile = null;
        try {
            zipFile = new ZipFile(file);
            Enumeration<? extends ZipEntry> enumeration = zipFile.entries();
            while (enumeration.hasMoreElements()) {
                ZipEntry entry = enumeration.nextElement();

                if (!entry.isDirectory() || directories) {
                    String fileName = "/" + entry.getName();
                    if (fileName.startsWith(path)) {
                        resources.add(fileName);
                    }
                }
            }
        }
        finally {
            if (zipFile != null) {
                zipFile.close();
            }
        }

        return resources;
    }