Skip to content

Commit

Permalink
Reduce usage of Ant
Browse files Browse the repository at this point in the history
  • Loading branch information
basil committed Dec 13, 2024
1 parent 7020e80 commit 9361455
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions core/src/main/java/hudson/model/DirectoryBrowserSupport.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,15 @@
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import jenkins.model.Jenkins;
import jenkins.security.MasterToSlaveCallable;
import jenkins.security.ResourceDomainConfiguration;
import jenkins.security.ResourceDomainRootAction;
import jenkins.util.SystemProperties;
import jenkins.util.VirtualFile;
import org.apache.commons.io.IOUtils;
import org.apache.tools.zip.ZipEntry;
import org.apache.tools.zip.ZipOutputStream;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;
import org.kohsuke.stapler.HttpResponse;
Expand Down Expand Up @@ -530,8 +530,8 @@ private static String createBackRef(int times) {

private static void zip(StaplerResponse2 rsp, VirtualFile root, VirtualFile dir, String glob) throws IOException, InterruptedException {
OutputStream outputStream = rsp.getOutputStream();
try (ZipOutputStream zos = new ZipOutputStream(outputStream)) {
zos.setEncoding(Charset.defaultCharset().displayName()); // TODO JENKINS-20663 make this overridable via query parameter
// TODO JENKINS-20663 make encoding overridable via query parameter
try (ZipOutputStream zos = new ZipOutputStream(outputStream, Charset.defaultCharset())) {

Check warning on line 534 in core/src/main/java/hudson/model/DirectoryBrowserSupport.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 534 is not covered by tests
// TODO consider using run(Callable) here

if (glob.isEmpty()) {
Expand Down
8 changes: 4 additions & 4 deletions core/src/main/java/jenkins/util/VirtualFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import jenkins.MasterToSlaveFileCallable;
import jenkins.model.ArtifactManager;
import jenkins.security.MasterToSlaveCallable;
Expand All @@ -68,8 +70,6 @@
import org.apache.tools.ant.types.selectors.SelectorUtils;
import org.apache.tools.ant.types.selectors.TokenizedPath;
import org.apache.tools.ant.types.selectors.TokenizedPattern;
import org.apache.tools.zip.ZipEntry;
import org.apache.tools.zip.ZipOutputStream;
import org.kohsuke.accmod.Restricted;
import org.kohsuke.accmod.restrictions.NoExternalUse;

Expand Down Expand Up @@ -375,8 +375,8 @@ public int zip(OutputStream outputStream, String includes, String excludes, bool
}

Collection<String> files = list(includes, excludes, useDefaultExcludes, openOptions);
try (ZipOutputStream zos = new ZipOutputStream(outputStream)) {
zos.setEncoding(Charset.defaultCharset().displayName()); // TODO JENKINS-20663 make this overridable via query parameter
// TODO JENKINS-20663 make encoding overridable via query parameter
try (ZipOutputStream zos = new ZipOutputStream(outputStream, Charset.defaultCharset())) {

Check warning on line 379 in core/src/main/java/jenkins/util/VirtualFile.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 379 is not covered by tests

for (String relativePath : files) {
VirtualFile virtualFile = this.child(relativePath);
Expand Down

0 comments on commit 9361455

Please sign in to comment.