@Override
    public void onFTP(
            final String senderIP,
            final String senderName,
            final String fileName,
            final String fullpath,
            final int socketNo,
            final long fileLength) {
        //
        // Process this ftp request with a thread so that
        // further messages can be processed without waiting for
        // finishing of this ftp.
        //
        Thread ftpThread = new Thread() {
            @Override
            public void run() {
                String directory;
                String file;

                synchronized (FTPListenerImpl.this) {
                    if (fSaveDialog == null) {
                        fSaveDialog = new FileDialog(fParentFrame,
                                "MessagingTool: " + StringDefs.SAVE_FILE_AS,
                                FileDialog.SAVE);
                    }

                    fSaveDialog.setFile(fileName);
                    ComponentUtil.overlapComponents(fSaveDialog, fParentFrame, 32, false);
                    fSaveDialog.setVisible(true);
                    fSaveDialog.dispose();

                    directory = fSaveDialog.getDirectory();
                    file = fSaveDialog.getFile();

                    if (directory == null || file == null) {
                        return;
                    }

                    if (directory.length() == 0 || file.length() == 0) {
                        return;
                    }
                }

                File newlyCreatedFile = new File(directory, file);

                try (FileOutputStream os = new FileOutputStream(newlyCreatedFile);) {
                    if (!FTP.getInstance().retrieve(senderIP, fullpath, file, os, socketNo, fileLength)) {
                        newlyCreatedFile.delete();
                    }
                } catch (IOException e) {
                    System.out.println(e);
                    newlyCreatedFile.delete();
                }
            }
        };

        ftpThread.setDaemon(true);
        ftpThread.start();
    }