Source:
<code>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(); <START> TraceUtils.createFolder(trace.getDestinationFolder(), monitor); <END> 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); } }</code><technical_language>local var destinationFolder instead of calling getDestinationFolder</technical_language>

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); } }