static ResultHandler downloadTo(Path saveDir, Path metaSaveDir) {
			return (conn) -> {
				// copy content from connection to file
				String fileName = extractFileName(conn);
				Path file = saveDir.resolve(fileName);
				Files.createDirectories(saveDir);
				Files.createDirectories(metaSaveDir);
				try (ReadableByteChannel readableByteChannel = Channels.newChannel(conn.getInputStream());
						FileOutputStream fileOutputStream = new FileOutputStream(file.toFile())) {
					fileOutputStream.getChannel().transferFrom(readableByteChannel, 0, Long.MAX_VALUE);
				}
				// create an .etag file if the information is present in the response headers
				String etag = conn.getHeaderField("ETag");
				if (etag != null) {
					writeString(etagFile(file, metaSaveDir), etag);
				}
				verboseMsg(String.format("Downloaded file %s", conn.getURL().toExternalForm()));
				return file;
			};
		}
Downloads a file from a URL

@param fileURL HTTP URL of the file to be downloaded
@param saveDir path of the directory to save the file
@param timeOut the timeout in milliseconds to use for opening the connection.
               0 is an infinite timeout while -1 uses the defaults
@return Path to the downloaded file
@throws IOException
src/main/java/dev/jbang/util/Util.java