Author Topic: [Java] XML Decorator  (Read 2441 times)

0 Members and 1 Guest are viewing this topic.

Offline Camel

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
    • BNU Bot
[Java] XML Decorator
« on: September 24, 2007, 12:15:29 pm »
XML decorator. Construct with a URL, go nuts.

http://bnubot.googlecode.com/svn/trunk/BNUBot/src/net/bnubot/vercheck/XMLElementDecorator.java

Sample use:
Code: [Select]
public static boolean checkVersion(ReleaseType release) throws Exception {
{
String url = "http://www.clanbnu.ws/bnubot/version.php";
if(CurrentVersion.version().revision() != null)
url += "?svn=" + CurrentVersion.version().revision();
url += "&release=" + release.toString();
elem = XMLElementDecorator.parse(url);
}

...

XMLElementDecorator motd = elem.getPath("bnubot/motd");
if(motd != null)
Out.info(VersionCheck.class, motd.getString());

...

XMLElementDecorator verLatest = elem.getPath("bnubot/latestVersion");
if(verLatest == null)
return false;

<Camel> i said what what
<Blaze> in the butt
<Camel> you want to do it in my butt?
<Blaze> in my butt
<Camel> let's do it in the butt
<Blaze> Okay!