protected void processIcons(ArtifactMetadata amd, RepositoryResourceWritable res) throws RepositoryException {
        String current = "";
        String sizeString = "";
        String iconName = "";
        String iconNames = amd.getIcons();

        if (iconNames != null) {
            iconNames.replaceAll("\\s", "");

            StringTokenizer s = new StringTokenizer(iconNames, ",");
            while (s.hasMoreTokens()) {
                current = s.nextToken();
                int size = 0;

                if (current.contains(";")) { // if the icon has an associated
                                             // size
                    StringTokenizer t = new StringTokenizer(current, ";");
                    while (t.hasMoreTokens()) {
                        sizeString = t.nextToken();

                        if (sizeString.contains("size=")) {
                            String sizes[] = sizeString.split("size=");
                            size = Integer.parseInt(sizes[sizes.length - 1]);
                        } else {
                            iconName = sizeString;
                        }
                    }

                } else {
                    iconName = current;
                }

                File icon = this.extractFileFromArchive(amd.getArchive().getAbsolutePath(), iconName).getExtractedFile();

                if (icon.exists()) {
                    AttachmentResourceWritable at = res.addAttachment(icon, AttachmentType.THUMBNAIL);
                    if (size != 0) {
                        at.setImageDimensions(size, size);
                    }
                } else {
                    throw new RepositoryArchiveEntryNotFoundException("Icon does not exist", amd.getArchive(), iconName);
                }
            }
        }
    }
protected void processIcons ( ArtifactMetadata amd , RepositoryResourceWritable res ) throws RepositoryException { String current = "" ; String sizeString = "" ; String iconName = "" ; String iconNames = amd . getIcons ( ) ; if ( iconNames != null ) { iconNames . replaceAll ( "\\s" , "" ) ; StringTokenizer s = new StringTokenizer ( iconNames , "," ) ; while ( s . hasMoreTokens ( ) ) { current = s . nextToken ( ) ; int size = 0 ; if ( current . contains ( ";" ) ) { StringTokenizer t = new StringTokenizer ( current , ";" ) ; while ( t . hasMoreTokens ( ) ) { sizeString = t . nextToken ( ) ; if ( sizeString . contains ( "size=" ) ) { String sizes [ ] = sizeString . split ( "size=" ) ; size = Integer . parseInt ( sizes [ sizes . length - 1 ] ) ; } else { iconName = sizeString ; } } } else { iconName = current ; } File icon = this . extractFileFromArchive ( amd . getArchive ( ) . getAbsolutePath ( ) , iconName ) . getExtractedFile ( ) ; if ( icon . exists ( ) ) { AttachmentResourceWritable at = res . addAttachment ( icon , AttachmentType . THUMBNAIL ) ; if ( size != 0 ) { at . setImageDimensions ( size , size ) ; } } else { throw new RepositoryArchiveEntryNotFoundException ( "Icon does not exist" , amd . getArchive ( ) , iconName ) ; } } } }
Process icons from the properties file

@param amd
Metadata
@param res
Resource to add icons to
@throws RepositoryException