private static List<String> getResourcesFromDirectory(File classpathEntry, File directory, String path, boolean directories) {

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

        for (File file : directory.listFiles()) {
            if (!file.isDirectory() || directories) {
                String fileName = file.getAbsolutePath().replace(classpathEntry.getAbsolutePath(), "").replaceAll("\\\\", "/");
                if (fileName.startsWith(path)) {
                    resources.add(fileName);
                }
            }

            if (file.isDirectory()) {
                resources.addAll(getResourcesFromDirectory(classpathEntry, file, path, directories));
            }
        }

        return resources;
    }