1 16 package org.apache.commons.vfs; 17 18 23 public class FileDepthSelector 24 implements FileSelector 25 { 26 private final int minDepth; 27 private final int maxDepth; 28 29 public FileDepthSelector(int minDepth, int maxDepth) 30 { 31 this.minDepth = minDepth; 32 this.maxDepth = maxDepth; 33 } 34 35 38 public boolean includeFile(final FileSelectInfo fileInfo) 39 { 40 final int depth = fileInfo.getDepth(); 41 return (minDepth <= depth && depth <= maxDepth); 42 } 43 44 47 public boolean traverseDescendents(final FileSelectInfo fileInfo) 48 { 49 return (fileInfo.getDepth() < maxDepth); 50 } 51 } 52 | Popular Tags |