test_class.file: gazeplay-commons/src/test/java/net/gazeplay/commons/utils/games/ResourceFileManagerTest.java
test_class.identifier: ResourceFileManagerTest
test_case.body: @Test
      void canRetrieveAllMatchingFiles() {
          Set<String> result = ResourceFileManager.getMatchingResources("data/common/bear.jpg");
          assert (result.size() == 1);
      }
test_case.class_method_signature: ResourceFileManagerTest.canRetrieveAllMatchingFiles()
test_case.full_signature: @Test void canRetrieveAllMatchingFiles()
test_case.identifier: canRetrieveAllMatchingFiles
test_case.invocations: getMatchingResources size
test_case.modifiers: @Test
test_case.parameters: ()
test_case.return: void
test_case.signature: void canRetrieveAllMatchingFiles()
focal_class.file: gazeplay-commons/src/main/java/net/gazeplay/commons/utils/games/ResourceFileManager.java
focal_class.identifier: ResourceFileManager
focal_class.class_method_signature: ResourceFileManager.getResourcePaths(String path)
focal_class.full_signature: public static Set<String> getResourcePaths(String path)
focal_class.identifier: getResourcePaths
focal_class.modifiers: public static
focal_class.parameters: (String path)
focal_class.return: Set<String>
focal_class.signature: Set<String> getResourcePaths(String path)
focal_class.class_method_signature: ResourceFileManager.getResourceFolders(String path)
focal_class.full_signature: public static Set<String> getResourceFolders(String path)
focal_class.identifier: getResourceFolders
focal_class.modifiers: public static
focal_class.parameters: (String path)
focal_class.return: Set<String>
focal_class.signature: Set<String> getResourceFolders(String path)
focal_class.class_method_signature: ResourceFileManager.resourceExists(String location)
focal_class.full_signature: public static boolean resourceExists(String location)
focal_class.identifier: resourceExists
focal_class.modifiers: public static
focal_class.parameters: (String location)
focal_class.return: boolean
focal_class.signature: boolean resourceExists(String location)
focal_class.class_method_signature: ResourceFileManager.getMatchingResources(String location)
focal_class.full_signature: public static Set<String> getMatchingResources(String location)
focal_class.identifier: getMatchingResources
focal_class.modifiers: public static
focal_class.parameters: (String location)
focal_class.return: Set<String>
focal_class.signature: Set<String> getMatchingResources(String location)
focal_class.class_method_signature: ResourceFileManager.createExtensionRegex(Set<String> fileExtensions)
focal_class.full_signature: static String createExtensionRegex(Set<String> fileExtensions)
focal_class.identifier: createExtensionRegex
focal_class.modifiers: static
focal_class.parameters: (Set<String> fileExtensions)
focal_class.return: String
focal_class.signature: String createExtensionRegex(Set<String> fileExtensions)
focal_method.body: 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();
          }
      }
focal_method.class_method_signature: ResourceFileManager.getMatchingResources(String location)
focal_method.full_signature: public static Set<String> getMatchingResources(String location)
focal_method.identifier: getMatchingResources
focal_method.invocations: get getParent getFileName toString toString equals equals emptySet getResourcePaths removeIf contains debug info toString emptySet
focal_method.modifiers: public static
focal_method.parameters: (String location)
focal_method.return: Set<String>
focal_method.signature: Set<String> getMatchingResources(String location)