private String getOutputFolder() throws JobExecutionException { String folderName = null; if(ConfigFlag.GEN.BATCH_JOB_EXPORT_FOLDER.getValue() == null || ConfigFlag.GEN.BATCH_JOB_EXPORT_FOLDER.getValue().length() == 0) { if ( System.getProperty("catalina.home") == null) { LOG.error("The JVM parameter 'catalina.home' was not found !"); throw new JobExecutionException("The JVM parameter 'catalina.home' was not found !"); } folderName = System.getProperty("catalina.home") + "/TransactionExport/"; } else { folderName = ConfigFlag.GEN.BATCH_JOB_EXPORT_FOLDER.getValue(); if(!(folderName.endsWith("\\") || folderName.endsWith("/"))) { folderName += System.getProperty("file.separator"); } } File folder = new File(folderName); if(folder.exists() == false) { boolean bSuccess = folder.mkdir(); if(bSuccess == false) { LOG.error("The JVM parameter 'catalina.home' was not found !"); throw new JobExecutionException("I could not create the folder '" + folder.getAbsolutePath() + "' !"); } } return folderName; }