Class FileDownloader
java.lang.Object
uk.ac.manchester.spinnaker.nmpiexec.utils.FileDownloader
Utilities for downloading a file.
-
Method Summary
Modifier and TypeMethodDescriptionstatic FiledownloadFile(String url, File workingDirectory, String defaultFilename) Downloads a file from a URL.static FiledownloadFile(URL url, File workingDirectory, String defaultFilename) Downloads a file from a URL.
-
Method Details
-
downloadFile
public static File downloadFile(URL url, File workingDirectory, String defaultFilename) throws IOException Downloads a file from a URL.- Parameters:
url- The URL to download the file fromworkingDirectory- The directory to output the file todefaultFilename- The name of the file to use if none can be worked out from the URL or headers, ornullto use a generated name- Returns:
- The file downloaded
- Throws:
IOException- If anything goes wrong.
-
downloadFile
public static File downloadFile(String url, File workingDirectory, String defaultFilename) throws IOException Downloads a file from a URL.- Parameters:
url- The URL to download the file fromworkingDirectory- The directory to output the file todefaultFilename- The name of the file to use if none can be worked out from the URL or headers, ornullto use a generated name- Returns:
- The file downloaded
- Throws:
IOException- If anything goes wrong.
-