Source:
public void perform( @Nonnull final Run<?, ?> run, @Nonnull final FilePath workspace, @Nonnull final Launcher launcher, @Nonnull final TaskListener listener) throws InterruptedException, IOException { TelemetryHelper.sendEvent("team-collect-results", new TelemetryHelper.PropertyMapBuilder() .build()); final PrintStream logger = listener.getLogger(); logger.print("Recording results..."); final File rootDir = run.getRootDir(); final File resultsRoot = new File(rootDir, TEAM_RESULTS); for (final TeamRequestedResult requestedResult : requestedResults) { final TeamResultType teamResultType = requestedResult.getTeamResultType(); final String folderName = teamResultType.getFolderName(); logger.print(" " + teamResultType.getDisplayName()); final File resultFolder = new File(resultsRoot, folderName); Files.createDirectory(resultFolder.toPath()); final String includes = requestedResult.getIncludes(); final FilePath resultPath = new FilePath(resultFolder); final int numCopied = workspace.copyRecursiveTo(includes, resultPath); logger.print(" (" + numCopied + " file" + ((numCopied == 1) ? "" : "s") + ")"); } logger.print(". Compressing..."); final ArchiverFactory zip = ArchiverFactory.ZIP; final File resultsZipFile = new File(rootDir, TEAM_RESULTS_ZIP); final FileOutputStream outputStream = new FileOutputStream(resultsZipFile); try { final Archiver archiver = zip.create(outputStream); try { final DirScanner scanner = new DirScanner.Glob(TEAM_RESULTS + "/**", null, false); scanner.scan(rootDir, archiver); } finally { IOUtils.closeQuietly(archiver); } } finally { IOUtils.closeQuietly(outputStream); } FileUtils.deleteDirectory(resultsRoot); TeamResultsAction.addToRun(run); logger.println(" Done."); }

Target:
public void perform( @Nonnull final Run<?, ?> run, @Nonnull final FilePath workspace, @Nonnull final Launcher launcher, @Nonnull final TaskListener listener) throws InterruptedException, IOException { TelemetryHelper.sendEvent("team-collect-results", new TelemetryHelper.PropertyMapBuilder() .build()); final PrintStream logger = listener.getLogger(); logger.print("Recording results..."); final File rootDir = run.getRootDir(); final File resultsRoot = new File(rootDir, TEAM_RESULTS); for (final TeamRequestedResult requestedResult : requestedResults) { final TeamResultType teamResultType = requestedResult.getTeamResultType(); final String folderName = teamResultType.getFolderName(); logger.print(" " + teamResultType.getDisplayName()); final File resultFolder = new File(resultsRoot, folderName); Files.createDirectories(resultFolder.toPath()); final String includes = requestedResult.getIncludes(); final FilePath resultPath = new FilePath(resultFolder); final int numCopied = workspace.copyRecursiveTo(includes, resultPath); logger.print(" (" + numCopied + " file" + ((numCopied == 1) ? "" : "s") + ")"); } logger.print(". Compressing..."); final ArchiverFactory zip = ArchiverFactory.ZIP; final File resultsZipFile = new File(rootDir, TEAM_RESULTS_ZIP); final FileOutputStream outputStream = new FileOutputStream(resultsZipFile); try { final Archiver archiver = zip.create(outputStream); try { final DirScanner scanner = new DirScanner.Glob(TEAM_RESULTS + "/**", null, false); scanner.scan(rootDir, archiver); } finally { IOUtils.closeQuietly(archiver); } } finally { IOUtils.closeQuietly(outputStream); } FileUtils.deleteDirectory(resultsRoot); TeamResultsAction.addToRun(run); logger.println(" Done."); }