private static void checkAndDeleteDir(FileSystem fileSystem, String directory) throws TestFailedException {
		try {
			if (fileSystem.pathExists(directory))
				fileSystem.deleteDirectoryRecursively(directory);
			
			if (fileSystem.pathExists(directory))
				throw new TestFailedException("I deleted the directory " + directory + " recursively, but pathExists says it does exist");
		} catch (PathNotFoundException e) {
			throw new TestFailedException("deleteDirectoryRecursively(" + directory + ")", e);
		} catch (AccessDeniedException e) {
			throw new TestFailedException(e);
		}
	}