private static Path getCachedFile(Path dir) throws IOException {
		if (Files.isDirectory(dir)) {
			try (Stream<Path> files = Files.list(dir)) {
				return files.findFirst().orElse(null);
			}
		} else {
			return null;
		}
	}
Checks if a file was previously downloaded and is available in the cache. The
result takes into account the connection status and freshness requests.

@param fileURL HTTP URL of the file to check
@return boolean indicating if the file can be retrieved from the cache
@throws IOException
src/main/java/dev/jbang/util/Util.java