src/main/java/edu/wisc/my/portlets/bookmarks/domain/CollectionFolder.java
public List<Entry> getSortedChildren() {
    	List<Entry> children = new ArrayList<Entry>();
    	log.debug("children: " + children.size());

		HttpClient client = new HttpClient();
		GetMethod get = null;

		try {

			log.debug("getting url " + url);
			get = new GetMethod(url);
			int rc = client.executeMethod(get);
			if (rc != HttpStatus.SC_OK) {
				log.error("HttpStatus:" + rc);
			}

			DocumentBuilderFactory domBuilderFactory = DocumentBuilderFactory
				.newInstance();
			DocumentBuilder builder = domBuilderFactory.newDocumentBuilder();

			InputStream in = get.getResponseBodyAsStream();
			builder = domBuilderFactory.newDocumentBuilder();
			Document doc = builder.parse(in);
			get.releaseConnection();
			
			Element e = (Element) doc.getElementsByTagName("rdf:RDF").item(0);
			log.debug("got root " + e);
			NodeList n = e.getElementsByTagName("item");
			log.debug("found items " + n.getLength());
			for (int i = 0; i < n.getLength(); i++) {
				Bookmark bookmark = new Bookmark();
				Element l = (Element) n.item(i);
				bookmark.setName(((Element) l.getElementsByTagName("title").item(0)).getTextContent());
				bookmark.setUrl(((Element) l.getElementsByTagName("link").item(0)).getTextContent());
				if (l.getElementsByTagName("description").getLength() > 0) {
					bookmark.setNote(((Element) l.getElementsByTagName("description").item(0)).getTextContent());
				}
				children.add(bookmark);
				log.debug("added bookmark " + bookmark.getName() + " " + bookmark.getUrl());
			}

		} catch (HttpException e) {
			log.error("Error parsing delicious", e);
		} catch (IOException e) {
			log.error("Error parsing delicious", e);
		} catch (ParserConfigurationException e) {
			log.error("Error parsing delicious", e);
		} catch (SAXException e) {
			log.error("Error parsing delicious", e);
		} finally {
			if (get != null)
				get.releaseConnection();
		}

    	log.debug("children: " + children.size());
    	return children;
    }
public List<Entry> getSortedChildren() {
    	List<Entry> children = new ArrayList<Entry>();
    	log.debug("children: " + children.size());

		HttpClient client = new HttpClient();
		GetMethod get = null;

		try {

			log.debug("getting url " + url);
			get = new GetMethod(url);
			int rc = client.executeMethod(get);
			if (rc != HttpStatus.SC_OK) {
				log.error("HttpStatus:" + rc);
			}

			DocumentBuilderFactory domBuilderFactory = DocumentBuilderFactory
				.newInstance();
			DocumentBuilder builder = domBuilderFactory.newDocumentBuilder();

			InputStream in = get.getResponseBodyAsStream();
			builder = domBuilderFactory.newDocumentBuilder();
			Document doc = builder.parse(in);
			get.releaseConnection();
			
			Element e = (Element) doc.getElementsByTagName("rdf:RDF").item(0);
			log.debug("got root " + e);
			NodeList n = e.getElementsByTagName("item");
			log.debug("found items " + n.getLength());
			for (int i = 0; i < n.getLength(); i++) {
				Bookmark bookmark = new Bookmark();
				Element l = (Element) n.item(i);
				bookmark.setName(((Element) l.getElementsByTagName("title").item(0)).getTextContent());
				bookmark.setUrl(((Element) l.getElementsByTagName("link").item(0)).getTextContent());
				if (l.getElementsByTagName("description").getLength() > 0) {
					bookmark.setNote(((Element) l.getElementsByTagName("description").item(0)).getTextContent());
				}
				children.add(bookmark);
				log.debug("added bookmark " + bookmark.getName() + " " + bookmark.getUrl());
			}

		} catch (HttpException e) {
			log.error("Error parsing delicious", e);
		} catch (IOException e) {
			log.error("Error parsing delicious", e);
		} catch (ParserConfigurationException e) {
			log.error("Error parsing delicious", e);
		} catch (SAXException e) {
			log.error("Error parsing delicious", e);
		} finally {
			if (get != null)
				get.releaseConnection();
		}

    	log.debug("children: " + children.size());
    	return children;
    }
public List < Entry > getSortedChildren ( ) { List < Entry > children = new ArrayList < Entry > ( ) ; log . debug ( "children: " + children . size ( ) ) ; HttpClient client = new HttpClient ( ) ; GetMethod get = null ; try { log . debug ( "getting url " + url ) ; get = new GetMethod ( url ) ; int rc = client . executeMethod ( get ) ; if ( rc != HttpStatus . SC_OK ) { log . error ( "HttpStatus:" + rc ) ; } DocumentBuilderFactory domBuilderFactory = DocumentBuilderFactory . newInstance ( ) ; DocumentBuilder builder = domBuilderFactory . newDocumentBuilder ( ) ; InputStream in = get . getResponseBodyAsStream ( ) ; builder = domBuilderFactory . newDocumentBuilder ( ) ; Document doc = builder . parse ( in ) ; get . releaseConnection ( ) ; Element e = ( Element ) doc . getElementsByTagName ( "rdf:RDF" ) . item ( 0 ) ; log . debug ( "got root " + e ) ; NodeList n = e . getElementsByTagName ( "item" ) ; log . debug ( "found items " + n . getLength ( ) ) ; for ( int i = 0 ; i < n . getLength ( ) ; i ++ ) { Bookmark bookmark = new Bookmark ( ) ; Element l = ( Element ) n . item ( i ) ; bookmark . setName ( ( ( Element ) l . getElementsByTagName ( "title" ) . item ( 0 ) ) . getTextContent ( ) ) ; bookmark . setUrl ( ( ( Element ) l . getElementsByTagName ( "link" ) . item ( 0 ) ) . getTextContent ( ) ) ; if ( l . getElementsByTagName ( "description" ) . getLength ( ) > 0 ) { bookmark . setNote ( ( ( Element ) l . getElementsByTagName ( "description" ) . item ( 0 ) ) . getTextContent ( ) ) ; } children . add ( bookmark ) ; log . debug ( "added bookmark " + bookmark . getName ( ) + " " + bookmark . getUrl ( ) ) ; } } catch ( HttpException e ) { log . error ( "Error parsing delicious" , e ) ; } catch ( IOException e ) { log . error ( "Error parsing delicious" , e ) ; } catch ( ParserConfigurationException e ) { log . error ( "Error parsing delicious" , e ) ; } catch ( SAXException e ) { log . error ( "Error parsing delicious" , e ) ; } finally { if ( get != null ) get . releaseConnection ( ) ; } log . debug ( "children: " + children . size ( ) ) ; return children ; }
Returns an immutable sorted view of the values of the children Map. The sorting is done
using the current childComparator. Warning, this is has a time cost of 2n log(n)
on every call.

@return An immutable sorted view of the folder's children.
Returns an immutable sorted view of the values of the children Map . The sorting is done using the current childComparator . Warning this is has a time cost of 2n log ( n ) on every call .