Class FileDownloader


  • public class FileDownloader
    extends Object
    A utility class for downloading files from the internet.
    • Constructor Detail

      • FileDownloader

        public FileDownloader()
    • Method Detail

      • downloadFile

        public static File downloadFile​(URL fileUrl,
                                        File targetDir,
                                        Component parentComponent)
                                 throws IOException
        Downloads a file from the specified URL to the specified local target directory. The method uses a Swing progress monitor to visualize the download process.
        Parameters:
        fileUrl - the URL of the file to be downloaded
        targetDir - the target directory
        parentComponent - the parent component to be used by the progress monitor
        Throws:
        IOException - if an I/O error occurs