Class FileDownloader

java.lang.Object
uk.ac.manchester.spinnaker.nmpiexec.utils.FileDownloader

public abstract class FileDownloader
extends Object
Utilities for downloading a file.
  • 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 from
      workingDirectory - The directory to output the file to
      defaultFilename - The name of the file to use if none can be worked out from the URL or headers, or null to 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 from
      workingDirectory - The directory to output the file to
      defaultFilename - The name of the file to use if none can be worked out from the URL or headers, or null to use a generated name
      Returns:
      The file downloaded
      Throws:
      IOException - If anything goes wrong.