test_class.file: kilt-core/src/test/java/de/poiu/kilt/bundlecontent/ResourceBundleContentHelperTest.java
test_class.identifier: ResourceBundleContentHelperTest
test_case.body: @Test
    public void testGetBundlePrefix() {
      final Path ignorableBasePath= Paths.get("/some/path/src/main/resources");
      final ResourceBundleContentHelper helper= new ResourceBundleContentHelper(ignorableBasePath);
      assertThat(helper.getBundlePrefix(ignorableBasePath.resolve("i18n/messages_de.properties"))).isEqualTo("i18n");
      assertThat(helper.getBundlePrefix(ignorableBasePath.resolve("i18n/my/sub/options_de.properties"))).isEqualTo("i18n/my/sub");
    }
test_case.class_method_signature: ResourceBundleContentHelperTest.testGetBundlePrefix()
test_case.full_signature: @Test public void testGetBundlePrefix()
test_case.identifier: testGetBundlePrefix
test_case.invocations: get isEqualTo assertThat getBundlePrefix resolve isEqualTo assertThat getBundlePrefix resolve
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetBundlePrefix()
focal_class.declarator: LOGGER= LogManager.getLogger()
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER= LogManager.getLogger();
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: PATTERN_RESOURCE_BUNDLE_FILE_NAME= Pattern.compile(
          "(?<BUNDLE>[a-zA-Z0-9\\-]+)"                                      //the bundle basename (mandatory)
        + "(?:_"                                                            //ignore the underscore of the optional LANG
        +   "(?<LOCALE>"                                                    //a group capturing all locale parts (LANG, SCRIPT, COUNTRY and VARIANT)
        +     "(?<LANG>[a-zA-Z]{2,8})"                                        //the optional LANG
        +     "(?:_"                                                          //ignore the underscore of the optional SCRIPT
        +       "(?<SCRIPT>[a-zA-Z]{4})"                                      //the optional SCRIPT
        +     ")?"
        +     "(?:_"                                                          //ignore the underscore of the optional COUNTRY
        +       "(?<COUNTRY>[a-zA-Z]{2}|[0-9]{3})"                            //the optional COUNTRY
        +     ")?"
        +     "(?:_"                                                          //ignore the underscore of the optional VARIANT
        +       "(?<VARIANT>[0-9a-zA-Z-]+.)"                                  //the optional VARIANT
        +     ")?"
        +   ")"
        + ")?"
        + "\\.properties"                                                   // the file must always have the suffix .properties
      , Pattern.UNICODE_CHARACTER_CLASS)
focal_class.modifier: protected static final
focal_class.original_string: protected static final Pattern PATTERN_RESOURCE_BUNDLE_FILE_NAME= Pattern.compile(
          "(?<BUNDLE>[a-zA-Z0-9\\-]+)"                                      //the bundle basename (mandatory)
        + "(?:_"                                                            //ignore the underscore of the optional LANG
        +   "(?<LOCALE>"                                                    //a group capturing all locale parts (LANG, SCRIPT, COUNTRY and VARIANT)
        +     "(?<LANG>[a-zA-Z]{2,8})"                                        //the optional LANG
        +     "(?:_"                                                          //ignore the underscore of the optional SCRIPT
        +       "(?<SCRIPT>[a-zA-Z]{4})"                                      //the optional SCRIPT
        +     ")?"
        +     "(?:_"                                                          //ignore the underscore of the optional COUNTRY
        +       "(?<COUNTRY>[a-zA-Z]{2}|[0-9]{3})"                            //the optional COUNTRY
        +     ")?"
        +     "(?:_"                                                          //ignore the underscore of the optional VARIANT
        +       "(?<VARIANT>[0-9a-zA-Z-]+.)"                                  //the optional VARIANT
        +     ")?"
        +   ")"
        + ")?"
        + "\\.properties"                                                   // the file must always have the suffix .properties
      , Pattern.UNICODE_CHARACTER_CLASS);
focal_class.type: Pattern
focal_class.var_name: PATTERN_RESOURCE_BUNDLE_FILE_NAME
focal_class.declarator: ignorableBasePath= Paths.get("")
focal_class.modifier: private
focal_class.original_string: private Path ignorableBasePath= Paths.get("");
focal_class.type: Path
focal_class.var_name: ignorableBasePath
focal_class.file: kilt-core/src/main/java/de/poiu/kilt/bundlecontent/ResourceBundleContentHelper.java
focal_class.identifier: ResourceBundleContentHelper
focal_class.class_method_signature: ResourceBundleContentHelper.ResourceBundleContentHelper()
focal_class.full_signature: public  ResourceBundleContentHelper()
focal_class.identifier: ResourceBundleContentHelper
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  ResourceBundleContentHelper()
focal_class.class_method_signature: ResourceBundleContentHelper.ResourceBundleContentHelper(final File ignorableBasePath)
focal_class.full_signature: public  ResourceBundleContentHelper(final File ignorableBasePath)
focal_class.identifier: ResourceBundleContentHelper
focal_class.modifiers: public
focal_class.parameters: (final File ignorableBasePath)
focal_class.signature:  ResourceBundleContentHelper(final File ignorableBasePath)
focal_class.class_method_signature: ResourceBundleContentHelper.ResourceBundleContentHelper(final Path ignorableBasePath)
focal_class.full_signature: public  ResourceBundleContentHelper(final Path ignorableBasePath)
focal_class.identifier: ResourceBundleContentHelper
focal_class.modifiers: public
focal_class.parameters: (final Path ignorableBasePath)
focal_class.signature:  ResourceBundleContentHelper(final Path ignorableBasePath)
focal_class.class_method_signature: ResourceBundleContentHelper.toBundleNameToFilesMap(final Collection<File> propertyFiles)
focal_class.full_signature: public Map<String, Map<Language, File>> toBundleNameToFilesMap(final Collection<File> propertyFiles)
focal_class.identifier: toBundleNameToFilesMap
focal_class.modifiers: public
focal_class.parameters: (final Collection<File> propertyFiles)
focal_class.return: Map<String, Map<Language, File>>
focal_class.signature: Map<String, Map<Language, File>> toBundleNameToFilesMap(final Collection<File> propertyFiles)
focal_class.class_method_signature: ResourceBundleContentHelper.getBundlePrefix(final Path path)
focal_class.full_signature: protected String getBundlePrefix(final Path path)
focal_class.identifier: getBundlePrefix
focal_class.modifiers: protected
focal_class.parameters: (final Path path)
focal_class.return: String
focal_class.signature: String getBundlePrefix(final Path path)
focal_class.class_method_signature: ResourceBundleContentHelper.getBundlePrefix(final File file)
focal_class.full_signature: protected String getBundlePrefix(final File file)
focal_class.identifier: getBundlePrefix
focal_class.modifiers: protected
focal_class.parameters: (final File file)
focal_class.return: String
focal_class.signature: String getBundlePrefix(final File file)
focal_method.body: protected String getBundlePrefix(final Path path) {
      LOGGER.traceEntry("getBundlePrefix for path: {}", path);
  
      Require.nonNull(path);
      if (!path.toAbsolutePath().startsWith(this.ignorableBasePath.toAbsolutePath())) {
        throw new IllegalArgumentException("All files should live below the ignorable base path "+this.ignorableBasePath.toAbsolutePath().toString()+". Given path is "+path.toAbsolutePath().toString());
      }
  
      final Path prefixPath= this.ignorableBasePath.toAbsolutePath().relativize(path.toAbsolutePath().getParent());
      final String bundlePrefix= prefixPath.toString()
        .replaceFirst("^/+", "")         //never start with a slash
        .replaceFirst("$/+", "")         //never end with a slash
        .replaceAll("\\/+", "/")       //reduce multiple slashes to only one
        ;
  
  
  
      return LOGGER.traceExit(bundlePrefix);
    }
focal_method.class_method_signature: ResourceBundleContentHelper.getBundlePrefix(final Path path)
focal_method.full_signature: protected String getBundlePrefix(final Path path)
focal_method.identifier: getBundlePrefix
focal_method.invocations: traceEntry nonNull startsWith toAbsolutePath toAbsolutePath toString toAbsolutePath toString toAbsolutePath relativize toAbsolutePath getParent toAbsolutePath replaceAll replaceFirst replaceFirst toString traceExit
focal_method.modifiers: protected
focal_method.parameters: (final Path path)
focal_method.return: String
focal_method.signature: String getBundlePrefix(final Path path)