private static boolean deleteDir(File dir) {
		try {
			logger.info("IN DELETEDIR");
			if (dir.isDirectory()) {
				String[] children = dir.list();
				for (int i=0; i<children.length; i++) {
					boolean success = deleteDir(new File(dir, children[i]));
					if (!success) {
						return false;
					}
				}
			}
		}
		catch(Exception e) {
			logger.error("BUG: {}", e);
		}

		// The directory is now empty so delete it
		return dir.delete();
	}