public static Collection<String> getResourceCollection(Class clazz, String path) throws IOException {

        Collection<String> resourceCollection = new HashSet<>();

        URL dirUrl = clazz.getResource(path);

        if (dirUrl == null) {

            try (
                    InputStream in = ResourceUtil.class.getResourceAsStream(path);
                    BufferedReader br = new BufferedReader(new InputStreamReader(in))) {

                String line;
                while ((line = br.readLine()) != null) {
                    resourceCollection.add(line);
                }
            }

        } else {

            switch (dirUrl.getProtocol()) {

                case "file":
                    try {
                        resourceCollection.addAll(Arrays.asList(new File(dirUrl.toURI()).list()));

                    } catch (URISyntaxException e) {
                        throw new IOException(e);
                    }
                    break;

                case "jar":
                    String jarPath = dirUrl.getPath().substring(5, dirUrl.getPath().indexOf("!"));
                    JarFile jar = new JarFile(URLDecoder.decode(jarPath, "UTF-8"));
                    Enumeration<JarEntry> entries = jar.entries();
                    while (entries.hasMoreElements()) {
                        String name = "/" + entries.nextElement().getName();
                        if (name.startsWith(path)) {
                            resourceCollection.add(name.substring(path.length() + 1));
                        }
                    }
            }
        }

        return resourceCollection;
    }