0 Replies Latest reply on Oct 26, 2006 8:06 PM by Scott Stark

    SuffixMatchFilter default VisitorAttributes does not make se

    Scott Stark Master

      A hangover from the isArchive removal is that the default VisitorAttributes.RECURSE_LEAVES_ONLY used by the org.jboss.virtual.plugins.vfs.helpers.SuffixMatchFilter don't work for "archives" (.jar, .sar, ... java archives, be they zip files or directories). This simple code usage:

      SuffixMatchFilter earLibFilter = SuffixMatchFilter(".jar");
      List<VirtualFile> archives = lib.getChildren(earLibFilter);

      results in no .jar files being found, even though they exist. The reason is that .jar files are directories, and only visiting leaves means they are not visited. They are in fact traversed for leaves to visit, and this is also not a default desired behavior, at least for this example usage. For this usage what we want is the VisitorAttributes.DEFAULT, which is to visit both leaves/non-leaves and not to recurse. I would say that this should be the default
      VisitorAttributes used.