private void addExternalItem(final FcpPersistentGet downloadRequest) { // direct downloads maybe have no filename, use identifier String fileName = downloadRequest.getFilename(); if (fileName == null) { fileName = downloadRequest.getIdentifier(); } else if (fileName.indexOf('/') > -1 || fileName.indexOf('\\') > -1) { // filename contains directories, use only filename final String stmp = new File(fileName).getName(); if (stmp.length() > 0) { fileName = stmp; // use plain filename } } final FrostDownloadItem dlItem = new FrostDownloadItem(fileName, downloadRequest.getUri()); dlItem.setExternal(true); dlItem.setGqIdentifier(downloadRequest.getIdentifier()); dlItem.setState(FrostDownloadItem.STATE_PROGRESS); SwingUtilities.invokeLater( new Runnable() { public void run() { downloadModel.addExternalItem(dlItem); } }); applyState(dlItem, downloadRequest); }