private void parseThumbnail(final Element e, final Metadata md) {
        final ArrayList<Thumbnail> values = new ArrayList<Thumbnail>();

        final List<Element> thumbnails = e.getChildren("thumbnail", getNS());
        for (final Element thumb : thumbnails) {
            try {

                final String timeAttr = Strings.trimToNull(thumb.getAttributeValue("time"));
                Time time = null;
                if (timeAttr != null) {
                    time = new Time(timeAttr);
                }

                final String widthAttr = thumb.getAttributeValue("width");
                final Integer width = Integers.parse(widthAttr);

                final String heightAttr = thumb.getAttributeValue("height");
                final Integer height = Integers.parse(heightAttr);

                final String url = thumb.getAttributeValue("url");
                final URI uri = new URI(url);
                final Thumbnail thumbnail = new Thumbnail(uri, width, height, time);

                values.add(thumbnail);

            } catch (final Exception ex) {
                LOG.warn("Exception parsing thumbnail tag.", ex);
            }
        }

        md.setThumbnail(values.toArray(new Thumbnail[values.size()]));
    }
private void parseThumbnail ( final Element e , final Metadata md ) { final ArrayList < Thumbnail > values = new ArrayList < Thumbnail > ( ) ; final List < Element > thumbnails = e . getChildren ( "thumbnail" , getNS ( ) ) ; for ( final Element thumb : thumbnails ) { try { final String timeAttr = Strings . trimToNull ( thumb . getAttributeValue ( "time" ) ) ; Time time = null ; if ( timeAttr != null ) { time = new Time ( timeAttr ) ; } final String widthAttr = thumb . getAttributeValue ( "width" ) ; final Integer width = Integers . parse ( widthAttr ) ; final String heightAttr = thumb . getAttributeValue ( "height" ) ; final Integer height = Integers . parse ( heightAttr ) ; final String url = thumb . getAttributeValue ( "url" ) ; final URI uri = new URI ( url ) ; final Thumbnail thumbnail = new Thumbnail ( uri , width , height , time ) ; values . add ( thumbnail ) ; } catch ( final Exception ex ) { LOG . warn ( "Exception parsing thumbnail tag." , ex ) ; } } md . setThumbnail ( values . toArray ( new Thumbnail [ values . size ( ) ] ) ) ; }
@param e element to parse
@param md metadata to fill in