Package org.jboss.vfs

Examples of org.jboss.vfs.VirtualFileFilter


            // Parse shared JARs for TLDs
            sharedTldMetaData = new ArrayList<TldMetaData>();
            if (tldJars != null)
            {
               VirtualFileFilter tldFilter = new SuffixMatchFilter(".tld", VisitorAttributes.DEFAULT);
               for (URL tldJar : tldJars)
               {
                  try
                  {
                     VirtualFile virtualFile = VFS.getChild(tldJar);
View Full Code Here


        Collection<VirtualFile> beans;
        final String name = root.getName();
        if (name.endsWith("jboss-beans.xml")) {
            beans = Collections.singleton(root);
        } else {
            VirtualFileFilter filter = new SuffixMatchFilter("jboss-beans.xml");
            beans = new ArrayList<VirtualFile>();
            try {
                // try plain .jar/META-INF
                VirtualFile metainf = root.getChild("META-INF");
                if (metainf.exists())
View Full Code Here

        Collection<VirtualFile> beans;
        final String name = root.getName();
        if(name.endsWith("jboss-beans.xml")) {
            beans = Collections.singleton(root);
        } else {
            VirtualFileFilter filter = new SuffixMatchFilter("jboss-beans.xml");
            beans = new ArrayList<VirtualFile>();
            try {
                // try plain .jar/META-INF
                VirtualFile metainf = root.getChild("META-INF");
                if (metainf.exists())
View Full Code Here

    }
  }

  protected void scanRoot(VirtualFile processArchiveRoot, final String[] additionalResourceSuffixes, Map<String, byte[]> resources) {
    try {
      List<VirtualFile> processes = processArchiveRoot.getChildrenRecursively(new VirtualFileFilter() {
        public boolean accepts(VirtualFile file) {
          return file.isFile() && ProcessApplicationScanningUtil.isDeployable(file.getName(), additionalResourceSuffixes);
        }
      });
      for (final VirtualFile process : processes) {
        addResource(process, processArchiveRoot, resources);
        // find diagram(s) for process
        List<VirtualFile> diagrams = process.getParent().getChildren(new VirtualFileFilter() {
          public boolean accepts(VirtualFile file) {
            return ProcessApplicationScanningUtil.isDiagram(file.getName(), process.getName());
          }
        });
        for (VirtualFile diagram : diagrams) {
View Full Code Here

            for (String lib : libs)
            {
                VirtualFile libVF = file.getChild(lib);
                if (libVF != null)
                {
                    VirtualFileFilter lf = filters.get(lib);
                    if (lf == null)
                        lf = libFilter;

                    List<VirtualFile> archives = libVF.getChildren(lf);
                    for (VirtualFile archive : archives)
                        addClassPath(structureContext, archive, true, true, context);
                } else
                {
                    if (log.isTraceEnabled())
                        log.info("No such lib: " + lib + ", " + file);
                }
            }

            // check only children of defined sub-dirs / groups
            for (String group : groups)
            {
                VirtualFile groupVF = file.getChild(group);
                if (groupVF != null)
                {
                    VirtualFileFilter gf = filters.get(group);
                    if (gf == null)
                        gf = groupFilter;

                    List<VirtualFile> children = groupVF.getChildren(gf);
                    for (VirtualFile child : children)
View Full Code Here

        Collection<VirtualFile> beans;
        final String name = root.getName();
        if (name.endsWith("jboss-beans.xml")) {
            beans = Collections.singleton(root);
        } else {
            VirtualFileFilter filter = new SuffixMatchFilter("jboss-beans.xml");
            beans = new ArrayList<VirtualFile>();
            try {
                // try plain .jar/META-INF
                VirtualFile metainf = root.getChild("META-INF");
                if (metainf.exists())
View Full Code Here

public class Filters {

    public static final VirtualFileFilter TRUE = MatchAllVirtualFileFilter.INSTANCE;

    public static VirtualFileFilter not(final VirtualFileFilter filter) {
        return new VirtualFileFilter() {
            @Override
            public boolean accepts(VirtualFile file) {
                return !filter.accepts(file);
            }
        };
View Full Code Here

            }
        };
    }

    public static VirtualFileFilter and(final VirtualFileFilter... filters) {
        return new VirtualFileFilter() {
            @Override
            public boolean accepts(VirtualFile file) {
                for(VirtualFileFilter f: filters) {
                    if(!f.accepts(file)){
                        return false;
View Full Code Here

            }
        };
    }

    public static VirtualFileFilter or(final VirtualFileFilter... filters) {
        return new VirtualFileFilter() {
            @Override
            public boolean accepts(VirtualFile file) {
                for(VirtualFileFilter f: filters) {
                    if(f.accepts(file)){
                        return true;
View Full Code Here

            }
        };
    }

    public static VirtualFileFilter wildcard(final String p){
        return new VirtualFileFilter() {
            private WildcardPattern pattern = new WildcardPattern(p);
            @Override
            public boolean accepts(VirtualFile file) {
                return pattern.matches(file.getPathName());
            }
View Full Code Here

TOP

Related Classes of org.jboss.vfs.VirtualFileFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.