1 19 20 package org.openidex.search; 21 22 import org.netbeans.api.queries.VisibilityQuery; 23 import org.openide.filesystems.FileObject; 24 25 29 final class VisibilityFilter implements FileObjectFilter { 30 31 33 public boolean searchFile(FileObject file) 34 throws IllegalArgumentException { 35 if (file.isFolder()) { 36 throw new java.lang.IllegalArgumentException ( 37 "file (not folder) expected"); } 39 return VisibilityQuery.getDefault().isVisible(file); 40 } 41 42 44 public int traverseFolder(FileObject folder) 45 throws IllegalArgumentException { 46 if (!folder.isFolder()) { 47 throw new java.lang.IllegalArgumentException ( 48 "folder expected"); } 50 return VisibilityQuery.getDefault().isVisible(folder) 51 ? TRAVERSE 52 : DO_NOT_TRAVERSE; 53 } 54 55 } 56 | Popular Tags |