Skip to content

Commit 6a2780f

Browse files
optimising js and removing cleanUpSupportBundleInTempFolder
1 parent a73e9d5 commit 6a2780f

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

src/main/resources/com/cloudbees/jenkins/support/SupportAction/progressPage.jelly

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
<h2>Generating Support Bundle</h2>
1111
<p id="progressMessage">Generating a support bundle for this Jenkins instance. This may take a few minutes.</p>
1212
<l:progressiveRendering handler="${it.getGeneratorByTaskId(request.getParameter('taskId'))}" callback="updateProgressUI"/>
13-
<p id="downloadMessage" style="display:none;">Your download should start automatically, if not <a href="downloadBundle?taskId=${request.getParameter('taskId')}">click here</a></p>
14-
<a id="downloadButton" style="display:none;" class="btn btn-primary" href="#">Download Support Bundle</a>
13+
<p id="downloadMessage" style="display:none;">Your download should start automatically, if not <a id="downloadButton" href="downloadBundle?taskId=${request.getParameter('taskId')}">click here</a></p>
1514
</l:main-panel>
1615

1716
<st:adjunct includes="js/progressPage"/>

src/test/java/com/cloudbees/jenkins/support/SupportActionTest.java

-21
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ public void generateBundlesByUIButtonClick() throws IOException, SAXException, I
110110
assertNotNull(supportBundle.getEntry("browser.md"));
111111
assertNotNull(supportBundle.getEntry("reverse-proxy.md"));
112112
assertNotNull(supportBundle.getEntry("nodes/master/logs/jenkins.log"));
113-
cleanUpSupportBundleInTempFolder();
114113
}
115114

116115
@Test
@@ -459,7 +458,6 @@ public void takeSnapshotAndMakeSureSomethingHappens() throws Exception {
459458
fail(r.getMessage());
460459
}
461460
}
462-
cleanUpSupportBundleInTempFolder();
463461
}
464462
}
465463

@@ -641,23 +639,4 @@ private void assertBundleNotContains(ZipFile zip, Collection<String> fileNames)
641639
assertNull(file + " was found in the bundle", zip.getEntry(file));
642640
}
643641
}
644-
645-
public void cleanUpSupportBundleInTempFolder() {
646-
try {
647-
if (!Files.exists(SUPPORT_BUNDLE_CREATION_FOLDER)) {
648-
return;
649-
}
650-
try (Stream<Path> paths = Files.walk(SUPPORT_BUNDLE_CREATION_FOLDER)) {
651-
paths.filter(Files::isRegularFile).forEach(path -> {
652-
try {
653-
Files.delete(path);
654-
} catch (IOException e) {
655-
throw new RuntimeException(e);
656-
}
657-
});
658-
}
659-
} catch (IOException e) {
660-
throw new RuntimeException(e);
661-
}
662-
}
663642
}

0 commit comments

Comments
 (0)