Ejemplo n.º 1
0
 /**
  * Refresh the repository from the URL.
  *
  * @throws Exception
  */
 public boolean refresh() {
   exception = null;
   try {
     resources.clear();
     parseDocument(url);
     visited = null;
     return true;
   } catch (Exception e) {
     e.printStackTrace();
     exception = e;
   }
   return false;
 }
Ejemplo n.º 2
0
 /**
  * We have a referral to another repository. Just create another parser and read it inline.
  *
  * @param parser
  */
 void referral(XmlPullParser parser) {
   // TODO handle depth!
   try {
     parser.require(XmlPullParser.START_TAG, null, "referral");
     // String depth = parser.getAttributeValue(null, "depth");
     String path = parser.getAttributeValue(null, "url");
     URL url = new URL(this.url, path);
     parseDocument(url);
     parser.next();
     parser.require(XmlPullParser.END_TAG, null, "referral");
   } catch (Exception e) {
     e.printStackTrace();
   }
 }