public boolean waitForPath(int waitTime, String path) {
		long timeout = System.currentTimeMillis() + waitTime;
		boolean exists = fileExists(path);
		while (!exists && System.currentTimeMillis() < timeout) {
			try {
				Thread.sleep(1000);
			}
			catch (InterruptedException e) {
				Thread.currentThread().interrupt();
				throw new IllegalStateException(e.getMessage(), e);
			}
			exists = fileExists(path);
		}
		return exists;
	}
Waits up to the timeout for the resource to be written to hdfs.

@param waitTime The number of millis to wait.
@param path the path to the resource .
@return false if the path was not present. True if it was present.
spring-xd-integration-test/src/main/java/org/springframework/xd/integration/util/HadoopUtils.java