String ucName = contents[entry].toUpperCase();
    public DirectoryItems( File rootDir, String categoryName,                           ItemFileFactory itemFactory )        throws IllegalArgumentException {        // Validate input.        if ( null == rootDir ) {            throw new IllegalArgumentException                ( "A null root directory was passed." ); //$NON-NLS-1$        }        else if ( !rootDir.isDirectory() ) {            throw new IllegalArgumentException                ( "The passed file is not a directory." ); //$NON-NLS-1$        }        if ( null == itemFactory ) {            throw new IllegalArgumentException                ( "A null item factory was passed." ); //$NON-NLS-1$        }        // Save the root category name and the item factory.        rootName = categoryName;        factory = itemFactory;        // Replace a null name with an empty name.        if ( null == rootName ) {            rootName = ""; //$NON-NLS-1$        }        /* DEBUG : uncomment this section to debug *        System.out.print( "Loading items from ");        System.out.println( rootDir.getPath() );        /* DEBUG : uncomment this section to debug */        // Walk through the contents of the root directory.        String[] contents = rootDir.list();        for ( int entry = 0; entry < contents.length; entry++ ) {            // Get the entry's file.            File file = new File( rootDir, contents[entry] );            // Convert the entry to upper case.            String ucName = contents[entry].toUpperCase();            // Is this entry a sub-directory?            if ( file.isDirectory() ) {                // Construct the category name for this sub-directory.                StringBuffer name = new StringBuffer();                name.append( rootName )                    .append( contents[entry] )                    .append( "/" ); //$NON-NLS-1$                // Parse the sub-directory, and add it to the map.                this.addCategory                    ( new DirectoryItems(file, name.toString(), factory) );            }            // Is this entry a ZIP or JAR file?            else if ( ZippedItems.isZipName( contents[entry] ) ) {                // Construct the category name for this ZIP file.                StringBuffer name = new StringBuffer();                name.append( rootName )                    .append( contents[entry] );                // Try to parse the ZIP file, and add it to the map.                try {                    this.addCategory                        ( new ZippedItems(file, name.toString(), factory) );                }                catch ( Exception err ) {                    // Print diagnostics and keep going.                    System.err.print( "Could not parse "); //$NON-NLS-1$                    System.err.println( contents[entry] );                    err.printStackTrace();                }            }            // Does the factory accept this entry?            else if ( factory.accept(rootDir, contents[entry]) ) {                // Save the ItemFile for this entry.                items.put( contents[entry], factory.getItemFile(file) );            }            /* DEBUG : uncomment this section to debug *            else {                System.out.print( "... ignoring " );                System.out.println( contents[entry] );            }            /* DEBUG : uncomment this section to debug */        } // Get the next entry in the root directory.        // If the root directory has any item files, add it to the map.        if ( !items.isEmpty() ) {            categories.put( rootName, this );        }    }