class ResourceFileManager {

    public static Set<String> getMatchingResources(String location) {
        try {
            Path path = Paths.get(location);

            Path parentPath = path.getParent();
            Path filenamePath = path.getFileName();

            String parent = parentPath != null ? parentPath.toString() : "";
            String filename = filenamePath != null ? filenamePath.toString() : "";

            if (parent.equals("") || filename.equals(""))
                return Collections.emptySet();

            Set<String> resources = getResourcePaths(parent);
            resources.removeIf(x -> !x.contains(filename));

            for (String resource : resources) {
                log.debug("ResourceFileManager : Found file = {}", resource);
            }
            return resources;
        } catch (InvalidPathException ie) {
            log.info("Path could not be found: {}", ie.toString());
            return Collections.emptySet();
        }
    }

}