String renameFile(String inputFilename){
  for (  Pattern searchExp : regexMappings.keySet()) {
    Matcher matcher=searchExp.matcher(inputFilename);
    if (matcher.find()) {
      String renamed=matcher.replaceFirst(regexMappings.get(searchExp));
      return FILE_SEP_CHAR_MATCHER.trimLeadingFrom(renamed);
    }
  }
  throw new MoeProblem("Cannot find a rename mapping that covers file %s. " + "Every file needs an applicable renaming rule.",inputFilename);
}

String renameFile ( String inputFilename ) { for ( Pattern searchExp : regexMappings . keySet ( ) ) { Matcher matcher = searchExp . matcher ( inputFilename ) ; if ( matcher . find ( ) ) { String renamed = matcher . replaceFirst ( regexMappings . get ( searchExp ) ) ; return FILE_SEP_CHAR_MATCHER . trimLeadingFrom ( renamed ) ; } } throw new MoeProblem ( "Cannot find a rename mapping that covers file %s. " + "Every file needs an applicable renaming rule." , inputFilename ) ; }
returns the filename according to the rules in mappings .
