public static String createDestinationForFoldername(String template,Movie movie){
  Pattern regex=Pattern.compile("\\{(.*?)\\}");
  Matcher mat=regex.matcher(template);
  while (mat.find()) {
    template=template.replace(mat.group(0),replaceOptionalVariable(mat.group(1),movie,false));
  }
  return createDestination(template,movie,false);
}

public static String createDestinationForFoldername ( String template , Movie movie ) { Pattern regex = Pattern . compile ( "\\{(.*?)\\}" ) ; Matcher mat = regex . matcher ( template ) ; while ( mat . find ( ) ) { template = template . replace ( mat . group ( 0 ) , replaceOptionalVariable ( mat . group ( 1 ) , movie , false ) ) ; } return createDestination ( template , movie , false ) ; }
creates the new filename according to template string
