public class IoUtil extends Object
Constructor and Description |
---|
IoUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
download(KitLogger log,
URL downloadUrl,
File target)
Download with showing the progress a given URL and store it in a file
|
static int |
getFreeRandomPort()
Find a free (on localhost) random port in the range [49152, 65535] after 100 attempts.
|
static int |
getFreeRandomPort(int min,
int max,
int attempts)
Find a free (on localhost) random port in the specified range after the given number of attempts.
|
static String |
sanitizeFileName(String name)
Returns an identifier from the given string that can be used as file name.
|
public static void download(KitLogger log, URL downloadUrl, File target) throws IOException
log
- logger used to track progressdownloadUrl
- url to downloadtarget
- target file where to store the downloaded dataIOException
- IO Exceptionpublic static int getFreeRandomPort()
public static int getFreeRandomPort(int min, int max, int attempts)
min
- minimum value for portmax
- maximum value for portattempts
- number of attemptsCopyright © 2021. All rights reserved.