<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Re: Scanning classes with VFS
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/grossetieg">Guillaume Grossetie</a> in <i>JBoss Microcontainer Development POJO Server</i> - <a href="http://community.jboss.org/message/561308#561308">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span>Thanks for the quick reply. I'm running <span>JBoss</span> 6.0.0.M3.</span></p><p>I will migrate to JBoss 6.0.0.M4 today to try the new scanning lib. I tried debugging :</p><pre class="jive-pre"><code class="jive-code jive-java" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: transparent; border-collapse: collapse; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: 1em; list-style-type: none; list-style-position: initial; list-style-image: initial; outline-width: 0px; outline-style: initial; outline-color: initial; background-position: initial initial; background-repeat: initial initial; padding: 0px; margin: 0px; border: 0px initial initial;"><span>URL resource = <span>cld</span>.<span>getResource</span>(<span>pkgPath</span>);</span></code></pre><p>With <em style="font-style: italic;"><span><span>pkgPath</span> = <span>mypackage</span>.etc.enumeration.action</span></em>, give me URL :</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span><span>vfs</span>:/home/<span>g</span>.<span>grossetie</span>/business/profiles/<span>jboss</span>-6.0.0.20100429-m3/server/default/deploy/deploy/1-calliope.ear/lib/framework-<span>ejbimpl</span>-2.0-SNAPSHOT-common.jar/<span>mypackage</span>/etc/enumeration/action/</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span>I guess that my <span>VirtualFile</span> is created correctly. Then when I call :</span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-java">file.getChildrenRecursively()
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-java">    <font color="darkgreen">/**
     * 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
     */</font>
    <font color="navy"><b>public</b></font> List<VirtualFile> getChildrenRecursively() <font color="navy"><b>throws</b></font> IOException <font color="navy">{</font>
        <font color="navy"><b>return</b></font> getChildrenRecursively(<font color="navy"><b>null</b></font>);
    <font color="navy">}</font>
 
    <font color="darkgreen">/**
     * 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
     */</font>
    <font color="navy"><b>public</b></font> List<VirtualFile> getChildrenRecursively(VirtualFileFilter filter) <font color="navy"><b>throws</b></font> IOException <font color="navy">{</font>
        <font color="navy"><b>if</b></font> (!isDirectory())
            <font color="navy"><b>return</b></font> Collections.emptyList();
        <font color="navy"><b>if</b></font> (filter == <font color="navy"><b>null</b></font>)
            filter = MatchAllVirtualFileFilter.INSTANCE;
        FilterVirtualFileVisitor visitor = <font color="navy"><b>new</b></font> FilterVirtualFileVisitor(filter, VisitorAttributes.RECURSE);
        visit(visitor);
        <font color="navy"><b>return</b></font> visitor.getMatched();
    <font color="navy">}</font>
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>the method return <span style="font-family: monospace; white-space: pre; "><span>Collections.<span>emptyList</span>();</span></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><pre class="jive-pre"><code class="jive-code jive-java"> <font color="navy"><b>if</b></font> (!isDirectory())
            <font color="navy"><b>return</b></font> Collections.emptyList();
</code></pre><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>So I can't interact with my classes because my package isn't a directory ?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Guillaume.</p><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">/**</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>     * Get all the children recursively<<span>p</span>></span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">     * <p/></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>     * This always uses {@link <span>VisitorAttributes</span>#<span>RECURSE</span>}</span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">     *</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">     * @return the children</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">     *</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>     * @throws <span>IOException</span> for any problem accessing the virtual file system</span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">     * @throws IllegalStateException if the file is closed</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">     */</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>    public List<<span>VirtualFile</span>> <span>getChildrenRecursively</span>() throws <span>IOException</span> {</span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">        return getChildrenRecursively(null);</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">    }</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"> </div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">    /**</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>     * Get all the children recursively<<span>p</span>></span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">     * <p/></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>     * This always uses {@link <span>VisitorAttributes</span>#<span>RECURSE</span>}</span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">     *</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>     * @<span>param</span> filter to filter the children</span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">     *</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">     * @return the children</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">     *</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>     * @throws <span>IOException</span> for any problem accessing the virtual file system</span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">     * @throws IllegalStateException if the file is closed or it is a leaf node</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">     */</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>    public List<<span>VirtualFile</span>> <span>getChildrenRecursively</span>(<span>VirtualFileFilter</span> filter) throws <span>IOException</span> {</span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">        if (!isDirectory())</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>            return Collections.<span>emptyList</span>();</span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">        if (filter == null)</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>            filter = <span>MatchAllVirtualFileFilter</span>.INSTANCE;</span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>        <span>FilterVirtualFileVisitor</span> visitor = new <span>FilterVirtualFileVisitor</span>(filter, <span>VisitorAttributes</span>.<span>RECURSE</span>);</span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">        visit(visitor);</div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;"><span>        return visitor.<span>getMatched</span>();</span></div><div id="_mcePaste" style="position: absolute; left: -10000px; top: 57px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">    }</div></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/561308#561308">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Microcontainer Development POJO Server at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2116">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>