public class DownloadUtil
extends java.lang.Object
| Constructor and Description |
|---|
DownloadUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
delete(java.io.File file)
Delete the file along with the corresponding ETag, if it exists.
|
static void |
downloadIfChanged(java.net.URL from,
java.io.File to,
org.gradle.api.logging.Logger logger)
Download from the given
URL to the given File so long as there are differences between them. |
static void |
downloadIfChanged(java.net.URL from,
java.io.File to,
org.gradle.api.logging.Logger logger,
boolean quiet)
Download from the given
URL to the given File so long as there are differences between them. |
static java.lang.String |
toNiceSize(long bytes)
Format the given number of bytes as a more human readable string.
|
public static void downloadIfChanged(java.net.URL from,
java.io.File to,
org.gradle.api.logging.Logger logger)
throws java.io.IOException
URL to the given File so long as there are differences between them.from - The URL of the file to be downloadedto - The destination to be saved to, and compared against if it existslogger - The logger to print everything to, typically from Project.getLogger()java.io.IOException - If an exception occurs during the processpublic static void downloadIfChanged(java.net.URL from,
java.io.File to,
org.gradle.api.logging.Logger logger,
boolean quiet)
throws java.io.IOException
URL to the given File so long as there are differences between them.from - The URL of the file to be downloadedto - The destination to be saved to, and compared against if it existslogger - The logger to print information to, typically from Project.getLogger()quiet - Whether to only print warnings (when true) or everythingjava.io.IOException - If an exception occurs during the processpublic static java.lang.String toNiceSize(long bytes)
bytes - The number of bytespublic static void delete(java.io.File file)
file - The file to delete.