public void transferEvent(TransferEvent e) { log.debug("ManifestDownloadListener.transferEvent: " + e); // check for possible recursive download if (e.getState() == TransferEvent.COMPLETED) { FileMetadata meta = e.getFileMetadata(); log.debug("file metadata: " + meta); if (meta != null && ManifestReader.CONTENT_TYPE.equals(meta.getContentType())) { // TODO: figure out which thread calls this... // should spawn a thread to do this or have one standing // by since the current thread is probably the one running the // download and we want to free it up asap log.debug("ManifestDownloadListener.transferEvent: current thread: " + Thread.currentThread().getName()); try { log.debug("manifest download: " + e.getFile()); ManifestReader mr = new ManifestReader(); Iterator<DownloadDescriptor> iter = mr.read(new FileReader(e.getFile())); add(iter); } catch (IOException ex) { log.error("failed to read download manifest " + e.getFile(), ex); } } } }