JBoss Community

Re: Scanning classes with VFS

created by Guillaume Grossetie in JBoss Microcontainer Development POJO Server - View the full discussion

Hi,

 

Thanks for the quick reply. I'm running JBoss 6.0.0.M3.

I will migrate to JBoss 6.0.0.M4 today to try the new scanning lib. I tried debugging :

URL resource = cld.getResource(pkgPath);

With pkgPath = mypackage.etc.enumeration.action, give me URL :

 

vfs:/home/g.grossetie/business/profiles/jboss-6.0.0.20100429-m3/server/default/deploy/deploy/1-calliope.ear/lib/framework-ejbimpl-2.0-SNAPSHOT-common.jar/mypackage/etc/enumeration/action/

 

I guess that my VirtualFile is created correctly. Then when I call :

 

file.getChildrenRecursively() 

 

 

    /**
     * Get all the children recursively<p>
     * <p/>
     * This always uses {@link VisitorAttributes#RECURSE}
     *
     * @return the children
     *
     * @throws IOException for any problem accessing the virtual file system
     * @throws IllegalStateException if the file is closed
     */
    public List<VirtualFile> getChildrenRecursively() throws IOException {
        return getChildrenRecursively(null);
    }
 
    /**
     * Get all the children recursively<p>
     * <p/>
     * This always uses {@link VisitorAttributes#RECURSE}
     *
     * @param filter to filter the children
     *
     * @return the children
     *
     * @throws IOException for any problem accessing the virtual file system
     * @throws IllegalStateException if the file is closed or it is a leaf node
     */
    public List<VirtualFile> getChildrenRecursively(VirtualFileFilter filter) throws IOException {
        if (!isDirectory())
            return Collections.emptyList();
        if (filter == null)
            filter = MatchAllVirtualFileFilter.INSTANCE;
        FilterVirtualFileVisitor visitor = new FilterVirtualFileVisitor(filter, VisitorAttributes.RECURSE);
        visit(visitor);
        return visitor.getMatched();
    }

 

the method return Collections.emptyList();

 

 

 if (!isDirectory())
            return Collections.emptyList();

 

 

So I can't interact with my classes because my package isn't a directory ?

 

 

Guillaume.

/**
     * Get all the children recursively<p>
     * <p/>
     * This always uses {@link VisitorAttributes#RECURSE}
     *
     * @return the children
     *
     * @throws IOException for any problem accessing the virtual file system
     * @throws IllegalStateException if the file is closed
     */
    public List<VirtualFile> getChildrenRecursively() throws IOException {
        return getChildrenRecursively(null);
    }
    /**
     * Get all the children recursively<p>
     * <p/>
     * This always uses {@link VisitorAttributes#RECURSE}
     *
     * @param filter to filter the children
     *
     * @return the children
     *
     * @throws IOException for any problem accessing the virtual file system
     * @throws IllegalStateException if the file is closed or it is a leaf node
     */
    public List<VirtualFile> getChildrenRecursively(VirtualFileFilter filter) throws IOException {
        if (!isDirectory())
            return Collections.emptyList();
        if (filter == null)
            filter = MatchAllVirtualFileFilter.INSTANCE;
        FilterVirtualFileVisitor visitor = new FilterVirtualFileVisitor(filter, VisitorAttributes.RECURSE);
        visit(visitor);
        return visitor.getMatched();
    }

Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer Development POJO Server at Community