mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-09 10:06:13 +00:00
Clean up VirtualFile after adding base implementation (#5212)
Co-authored-by: Daniel Beck <daniel-beck@users.noreply.github.com>
This commit is contained in:
1 parent
9dc60c0615
commit
792efa7c24
1 file changed
-24
@@ -660,18 +660,6 @@ public abstract class VirtualFile implements Comparable<VirtualFile>, Serializab
|
||||
return new Scanner(includes, excludes, useDefaultExcludes, rootPath, noFollowLinks).invoke(f, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int zip(OutputStream outputStream, String includes, String excludes, boolean useDefaultExcludes,
|
||||
boolean noFollowLinks, String prefix) throws IOException {
|
||||
String rootPath = determineRootPath();
|
||||
DirScanner.Glob globScanner = new DirScanner.Glob(includes, excludes, useDefaultExcludes, !noFollowLinks);
|
||||
ArchiverFactory archiverFactory = noFollowLinks ? ArchiverFactory.createZipWithoutSymlink(prefix) : ArchiverFactory.ZIP;
|
||||
try (Archiver archiver = archiverFactory.create(outputStream)) {
|
||||
globScanner.scan(f, FilePath.ignoringSymlinks(archiver, rootPath, noFollowLinks));
|
||||
return archiver.countEntries();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasSymlink(boolean noFollowLinks) throws IOException {
|
||||
String rootPath = determineRootPath();
|
||||
@@ -969,18 +957,6 @@ public abstract class VirtualFile implements Comparable<VirtualFile>, Serializab
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int zip(OutputStream outputStream, String includes, String excludes, boolean useDefaultExcludes,
|
||||
boolean noFollowLinks, String prefix) throws IOException {
|
||||
try {
|
||||
String rootPath = root == null ? null : root.getRemote();
|
||||
DirScanner.Glob globScanner = new DirScanner.Glob(includes, excludes, useDefaultExcludes, !noFollowLinks);
|
||||
return f.zip(outputStream, globScanner, rootPath, noFollowLinks, prefix);
|
||||
} catch (InterruptedException x) {
|
||||
throw new IOException(x);
|
||||
}
|
||||
}
|
||||
|
||||
@Override public VirtualFile child(String name) {
|
||||
return new FilePathVF(f.child(name), this.root);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user