standaloneExecutables/src/main/java/com/ge/research/semtk/standaloneExecutables/IngestTemplateGenerator.java
private static void cleanOrCreateDir(String dirName, String cleanExtension) throws Exception {
		boolean first = true;
		File d = new File(dirName);
		if (d.exists()) {
			for (File f : d.listFiles()) {
				if (first) {
					System.out.println("Deleting *" + cleanExtension + " in " + dirName);
					first = false;
				}
				
				if (f.getName().toLowerCase().endsWith(cleanExtension)) {
					f.delete();
				}
			}
		} else if (! d.mkdirs()) {
			throw new Exception("Directory could not be created:" + dirName);
		} else {
			System.out.println("Creating " + dirName);
		}
	}
/**
	 * If dir exists, clean out files ending in cleanExtension, otherwise try to create the dir
	 * @param dirName
	 * @param cleanExtension
	 * @throws Exception
	 */
If dir exists, clean out files ending in cleanExtension, otherwise try to create the dir
@param dirName
@param cleanExtension
@throws Exception
If dir exists clean out files ending in cleanExtension otherwise try to create the dir @param dirName @param cleanExtension @throws Exception
private static void cleanOrCreateDir(String dirName, String cleanExtension) throws Exception {
		boolean first = true;
		File d = new File(dirName);
		if (d.exists()) {
			for (File f : d.listFiles()) {
				if (first) {
					System.out.println("Deleting *" + cleanExtension + " in " + dirName);
					first = false;
				}
				if (f.getName().toLowerCase().endsWith(cleanExtension)) {
					f.delete();
				}
			}
		} else if (! d.mkdirs()) {
			throw new Exception("Directory could not be created:" + dirName);
		} else {
			System.out.println("Creating " + dirName);
		}
	}
private static void cleanOrCreateDir ( String dirName , String cleanExtension ) throws Exception { boolean first = true ; File d = new File ( dirName ) ; if ( d . exists ( ) ) { for ( File f : d . listFiles ( ) ) { if ( first ) { System . out . println ( "Deleting *" + cleanExtension + " in " + dirName ) ; first = false ; } if ( f . getName ( ) . toLowerCase ( ) . endsWith ( cleanExtension ) ) { f . delete ( ) ; } } } else if ( ! d . mkdirs ( ) ) { throw new Exception ( "Directory could not be created:" + dirName ) ; } else { System . out . println ( "Creating " + dirName ) ; } }
If dir exists, clean out files ending in cleanExtension, otherwise try to create the dir
 @param dirName
 @param cleanExtension
 @throws Exception
If dir exists clean out files ending in cleanExtension otherwise try to create the dir @param dirName @param cleanExtension @throws Exception