commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 37597] - [jci] add list() method to readers and stores
Date Thu, 24 Nov 2005 03:42:35 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=37597>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37597





------- Additional Comments From mproctor@codehaus.org  2005-11-24 04:42 -------
Made a mistake, stores should return class names - not file names. Readers
return relative file names.

MemoryResourceStore:
    public String[] list() {
        if ( store == null ) {
            return new String[0];
        }
        List names =new ArrayList();
        Iterator it = this.store.keySet().iterator();
        String name = null;
        while ( it.hasNext() ) {
            name = (String) it.next();
            names.add( name.replace('/', '.').substring( 0 , name.length() - 6) );
        }
        
        return ( String[] ) names.toArray( new String[ this.store.size() ] );
    }
FileResourceStore:
    public String[] list() {
        if ( store == null ) {
            return new String[0];
        }
        List names =new ArrayList();
        Iterator it = this.store.keySet().iterator();
        String name = null;
        while ( it.hasNext() ) {
            name = (String) it.next();
            names.add( name.replace('/', '.').substring( 0 , name.length() - 6) );
        }
        
        return ( String[] ) names.toArray( new String[ this.store.size() ] );
    }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message