private String getContents(int timeout) throws IOException {
		if (waitFor(file, timeout)) {
			return FileCopyUtils.copyToString(new InputStreamReader(new FileInputStream(file), charset));
		}
		else {
			throw new IOException(String.format("Timeout after %dms waiting for file %s", timeout, file));
		}
	}
Wait at most {@code timeout} ms for the file to appear and return its contents.
spring-xd-test-fixtures/src/main/java/org/springframework/xd/test/fixtures/FileSink.java