private static String getFileName ( @ Nullable final MapPrinter mapPrinter , final PJsonObject spec ) { String fileName = spec . optString ( Constants . OUTPUT_FILENAME_KEY ) ; if ( fileName != null ) { return fileName ; } if ( mapPrinter != null ) { final Configuration config = mapPrinter . getConfiguration ( ) ; final String templateName = spec . getString ( Constants . JSON_LAYOUT_KEY ) ; final Template template = config . getTemplate ( templateName ) ; if ( template . getOutputFilename ( ) != null ) { return template . getOutputFilename ( ) ; } if ( config . getOutputFilename ( ) != null ) { return config . getOutputFilename ( ) ; } } return "mapfish-print-report" ; }
Read filename from spec .