public static void checkOutputPath(File targetPath)
	{
		
		if(targetPath != null && targetPath.exists()) {
			// shows a window which asks you if the old content of the output directory should be deleted
//		    int confirmation = JOptionPane.showConfirmDialog(null, "Output directory not empty. Delete all contents of '" + targetPath + "' and continue?", "Confirmation", JOptionPane.YES_NO_OPTION);
//		    if (confirmation == JOptionPane.NO_OPTION)
//		        return;

			try {
				FileUtils.deleteDirectory(targetPath);
			} catch (IOException e1) {
				throw new RuntimeException("Unable to clean output directory: " + e1.getMessage(), e1);
			}
			targetPath.mkdirs();
		}
		if(!targetPath.exists())
			targetPath.mkdir();
	}