private File downloadBackupToFile(String backupName, String outputDirectory, long totalFileBytes) {
        final PipedInputStream ftpDataInStream = new PipedInputStream();
        File outFile = null;
        try {
            PipedOutputStream ftpDataOutStream = new PipedOutputStream(ftpDataInStream);

            outFile = new File(outputDirectory, backupName);
            if (outFile.createNewFile()){
                final FileOutputStream fileOutputStream = new FileOutputStream(outFile);
                new Thread(
                        new Runnable() {
                            public void run() {
                                try {
                                    synchronized (asyncThreadMonitor) {
                                        bytesDownloaded = IOUtils.copy(ftpDataInStream, fileOutputStream);
                                        if (bytesDownloaded > 0) bytesDownloaded += 0;
                                    }
                                } catch (IOException e) {
                                    throw new RuntimeException("Exception in copy thread", e);
                                }
                            }
                        }
                ).start();
            } else {
                com.unispezi.cpanelremotebackup.tools.Console.println("ERROR: Cannot create \"" + outFile + "\", file already exists.");
            }

            com.unispezi.cpanelremotebackup.tools.Console.println("Downloading " + backupName + " to " + outFile.getPath() + " :");
            com.unispezi.cpanelremotebackup.tools.Console.print("0% ");

            FTPClient.ProgressListener listener = new FTPClient.ProgressListener() {
                int lastPrintedPercentage = 0;

                @Override
                public void progressPercentageReached(int percentage) {
                    int percentageRounded = percentage / 10;
                    if ( percentageRounded > lastPrintedPercentage){
                        lastPrintedPercentage = percentageRounded;
                        com.unispezi.cpanelremotebackup.tools.Console.print(percentageRounded * 10 + "% ");
                    }
                }
            };

            ftp.downloadFile(backupName, ftpDataOutStream, listener, totalFileBytes);
            synchronized (asyncThreadMonitor) {
                com.unispezi.cpanelremotebackup.tools.Console.println("\nDownloaded " + bytesDownloaded + " bytes successfully");
            }
        } catch (IOException e) {
            com.unispezi.cpanelremotebackup.tools.Console.println("ERROR: Cannot download backup: " + e);
        }
        return outFile;
    }