class ResourceBundleContentHelper {

  public Map<String, Map<Language, File>> toBundleNameToFilesMap(final Collection<File> propertyFiles) {
    Require.nonNull(propertyFiles);
    final Map<String, Map<Language, File>> result= new LinkedHashMap<>();

    for (final File file : propertyFiles) {
      final Matcher matcher = PATTERN_RESOURCE_BUNDLE_FILE_NAME.matcher(file.getName());
      if (matcher.matches()) {
        final String bundleBasename= matcher.group("BUNDLE");
        final String langCode= matcher.group("LOCALE");
        final Language language= Language.of(langCode != null ? langCode : "");

        final String bundlePrefix= getBundlePrefix(file);
        final String fullBundleName;
        if (bundlePrefix == null || bundlePrefix.trim().isEmpty()) {
          fullBundleName= bundleBasename;
        } else {
          fullBundleName= bundlePrefix + "/" + bundleBasename;
        }

        if (!result.containsKey(fullBundleName)) {
          result.put(fullBundleName, new LinkedHashMap<>());
        }

        final Map<Language, File> langToFileMap= result.get(fullBundleName);
        if (langToFileMap.containsKey(language)) {
          throw new RuntimeException("Language "+langCode+" already in map. Should never happen.");
        }
        langToFileMap.put(language, file);
      } else {
        LOGGER.log(Level.WARN, "File {} doesn't match the expected pattern. It will not be processed! Does your file name end with .properties?", file.getAbsolutePath());
      }
    }

    return result;
  }

  public  ResourceBundleContentHelper();
  public  ResourceBundleContentHelper(final File ignorableBasePath);
  public  ResourceBundleContentHelper(final Path ignorableBasePath);

}