Source:
private static void downloadTrace(ImportFileInfo trace, IProject project, IProgressMonitor monitor) throws ExecutionException { try { IRemoteFileSubSystem fsss = trace.getImportFile().getParentRemoteFileSubSystem(); IFolder traceFolder = project.getFolder(TmfTracesFolder.TRACES_FOLDER_NAME); if (!traceFolder.exists()) { throw new ExecutionException(Messages.TraceControl_ImportDialogInvalidTracingProject + " (" + TmfTracesFolder.TRACES_FOLDER_NAME + ")"); } IFolder destinationFolder = trace.getDestinationFolder(); TraceUtils.createFolder(trace.getDestinationFolder(), monitor); String traceName = trace.getLocalTraceName(); IFolder folder = destinationFolder.getFolder(traceName); if (folder.exists()) { if(!trace.isOverwrite()) { throw new ExecutionException(Messages.TraceControl_ImportDialogTraceAlreadyExistError + ": " + traceName); } } else { folder.create(true, true, null); } IRemoteFile[] sources = fsss.list(trace.getImportFile(), IFileService.FILE_TYPE_FILES, new NullProgressMonitor()); SubMonitor subMonitor = SubMonitor.convert(monitor, sources.length); subMonitor.beginTask(Messages.TraceControl_DownloadTask, sources.length); for (int i = 0; i < sources.length; i++) { if (subMonitor.isCanceled()) { monitor.setCanceled(true); return; } String destination = folder.getLocation().addTrailingSeparator().append(sources[i].getName()).toString(); subMonitor.setTaskName(Messages.TraceControl_DownloadTask + ' ' + traceName + '/' +sources[i].getName()); fsss.download(sources[i], destination, null, subMonitor.newChild(1)); } } catch (SystemMessageException e) { throw new ExecutionException(e.toString(), e); } catch (CoreException e) { throw new ExecutionException(e.toString(), e); } }

Target:
private static void downloadTrace(ImportFileInfo trace, IProject project, IProgressMonitor monitor) throws ExecutionException { try { IRemoteFileSubSystem fsss = trace.getImportFile().getParentRemoteFileSubSystem(); IFolder traceFolder = project.getFolder(TmfTracesFolder.TRACES_FOLDER_NAME); if (!traceFolder.exists()) { throw new ExecutionException(Messages.TraceControl_ImportDialogInvalidTracingProject + " (" + TmfTracesFolder.TRACES_FOLDER_NAME + ")"); } IFolder destinationFolder = trace.getDestinationFolder(); TraceUtils.createFolder(destinationFolder, monitor); String traceName = trace.getLocalTraceName(); IFolder folder = destinationFolder.getFolder(traceName); if (folder.exists()) { if(!trace.isOverwrite()) { throw new ExecutionException(Messages.TraceControl_ImportDialogTraceAlreadyExistError + ": " + traceName); } } else { folder.create(true, true, null); } IRemoteFile[] sources = fsss.list(trace.getImportFile(), IFileService.FILE_TYPE_FILES, new NullProgressMonitor()); SubMonitor subMonitor = SubMonitor.convert(monitor, sources.length); subMonitor.beginTask(Messages.TraceControl_DownloadTask, sources.length); for (int i = 0; i < sources.length; i++) { if (subMonitor.isCanceled()) { monitor.setCanceled(true); return; } String destination = folder.getLocation().addTrailingSeparator().append(sources[i].getName()).toString(); subMonitor.setTaskName(Messages.TraceControl_DownloadTask + ' ' + traceName + '/' +sources[i].getName()); fsss.download(sources[i], destination, null, subMonitor.newChild(1)); } } catch (SystemMessageException e) { throw new ExecutionException(e.toString(), e); } catch (CoreException e) { throw new ExecutionException(e.toString(), e); } }