/** * @since 1.532 */ protected final void scanSingle(File f, String relative, FileVisitor visitor) throws IOException { if (visitor.understandsSymlink()) { String target; try { target = Util.resolveSymlink(f); } catch (IOException x) { // JENKINS-13202 target = null; } if (target != null) { visitor.visitSymlink(f, target, relative); return; } } visitor.visit(f, relative); }
@Override public void scan(File dir, FileVisitor visitor) throws IOException { super.scan(dir,visitor.with(filter)); }
/** * Some visitors can handle symlinks as symlinks. Those visitors should implement * this method to provide a different handling for symlink. * <p> * This method is invoked by those {@link DirScanner}s that can handle symlinks as symlinks. * (Not every {@link DirScanner}s are capable of doing that, as proper symlink handling requires * letting visitors decide whether or not to descend into a symlink directory.) */ public void visitSymlink(File link, String target, String relativePath) throws IOException { visit(link,relativePath); }
@Override public boolean understandsSymlink() { return v.understandsSymlink(); } };
@Override public void visitSymlink(File link, String target, String relativePath) throws IOException { filter.read(link); v.visitSymlink(link, target, relativePath); }
public void visit(File f, String relativePath) throws IOException { if(f.isDirectory() || filter.accept(f)) visitor.visit(f,relativePath); }
@Override public boolean understandsSymlink() { return v.understandsSymlink(); } };
@Override public void visitSymlink(File link, String target, String relativePath) throws IOException { filter.read(link); v.visitSymlink(link, target, relativePath); }
/** * @since 1.532 */ protected final void scanSingle(File f, String relative, FileVisitor visitor) throws IOException { if (visitor.understandsSymlink()) { try { String target; try { target = Util.resolveSymlink(f); } catch (IOException x) { // JENKINS-13202 target = null; } if (target != null) { visitor.visitSymlink(f, target, relative); return; } } catch (InterruptedException e) { throw (IOException) new InterruptedIOException().initCause(e); } } visitor.visit(f, relative); }
@Override public void visit(File f, String relativePath) throws IOException { filter.read(f); v.visit(f,relativePath); }
@Override public void scan(File dir, FileVisitor visitor) throws IOException { super.scan(dir, visitor.with(filter)); } private static final long serialVersionUID = 1L;
private void scan(File f, String path, FileVisitor visitor) throws IOException { if (f.canRead()) { if (visitor.understandsSymlink()) { String target = Util.resolveSymlink(f, TaskListener.NULL); if (target != null) { visitor.visitSymlink(f, target, path + f.getName()); return; } } visitor.visit(f, path + f.getName()); if (f.isDirectory()) { for (File child : f.listFiles()) { scan(child, path + f.getName() + '/', visitor); } } } }
/** * Some visitors can handle symlinks as symlinks. Those visitors should implement * this method to provide a different handling for symlink. * <p> * This method is invoked by those {@link DirScanner}s that can handle symlinks as symlinks. * (Not every {@link DirScanner}s are capable of doing that, as proper symlink handling requires * letting visitors decide whether or not to descend into a symlink directory.) */ public void visitSymlink(File link, String target, String relativePath) throws IOException { visit(link,relativePath); }
@Override public void scan(File dir, FileVisitor visitor) throws IOException { super.scan(dir,visitor.with(filter)); }
private void scan(File f, String path, FileVisitor visitor) throws IOException { if (f.canRead()) { if (visitor.understandsSymlink()) { String target = Util.resolveSymlink(f, TaskListener.NULL); if (target != null) { visitor.visitSymlink(f, target, path + f.getName()); return; } } visitor.visit(f,path+f.getName()); if(f.isDirectory()) { for( File child : f.listFiles() ) scan(child,path+f.getName()+'/',visitor); } } }
/** * Some visitors can handle symlinks as symlinks. Those visitors should implement * this method to provide a different handling for symlink. * <p> * This method is invoked by those {@link DirScanner}s that can handle symlinks as symlinks * (not every {@link DirScanner}s are capable of doing that, as proper symlink handling requires * letting visitors decide whether or not to descend into a symlink directory. */ public void visitSymlink(File link, String target, String relativePath) throws IOException { visit(link,relativePath); }
@Override public void scan(File dir, FileVisitor visitor) throws IOException { super.scan(dir,visitor.with(filter)); }
private void scan(File f, String path, FileVisitor visitor) throws IOException { if (f.canRead()) { if (visitor.understandsSymlink()) { try { String target = Util.resolveSymlink(f, TaskListener.NULL); if (target!=null) { visitor.visitSymlink(f,target,path+f.getName()); return; } } catch (InterruptedException e) { throw (IOException)new InterruptedIOException().initCause(e); } } visitor.visit(f,path+f.getName()); if(f.isDirectory()) { for( File child : f.listFiles() ) scan(child,path+f.getName()+'/',visitor); } } }
/** * Some visitors can handle symlinks as symlinks. Those visitors should implement * this method to provide a different handling for symlink. * <p> * This method is invoked by those {@link DirScanner}s that can handle symlinks as symlinks * (not every {@link DirScanner}s are capable of doing that, as proper symlink handling requires * letting visitors decide whether or not to descend into a symlink directory. */ public void visitSymlink(File link, String target, String relativePath) throws IOException { visit(link,relativePath); }
@Override public void scan(File dir, FileVisitor visitor) throws IOException { super.scan(dir,visitor.with(filter)); }