Package games.stendhal.client.update

Examples of games.stendhal.client.update.HttpClient


    boolean success;

    try {
      while(keyword != null) {
        // look it up using the Wikipedia API
        final HttpClient httpClient = new HttpClient(
            "http://en.wikipedia.org/w/api.php?action=query&titles="
                + keyword.replace(' ', '_').replace("%", "%25")
                + "&prop=revisions&rvprop=content&format=xml");
        final SAXParserFactory factory = SAXParserFactory.newInstance();

        // Parse the input
        final SAXParser saxParser = factory.newSAXParser();
        saxParser.parse(httpClient.getInputStream(), this);

        final String response = getText();

        if (response.startsWith("#REDIRECT")) {
          // extract the new keyword
View Full Code Here


  private void showHelp() {
    BareBonesBrowserLaunch.openURL("http://stendhalgame.org/wiki/Stendhal_Manual");
  }

  private void checkVersion() {
    final HttpClient httpClient = new HttpClient(
        ClientGameConfiguration.get("UPDATE_VERSION_CHECK"));
    final String version = httpClient.fetchFirstLine();
    if (version != null) {
      if (Version.compare(version, stendhal.VERSION) > 0) {
        // custom title, warning icon
        JOptionPane.showMessageDialog(
            this,
View Full Code Here

    String urlHost = host;
    if (host.indexOf(":") > -1) {
      urlHost = "[" + host + "]";
    }
    final String testServer = "http://" + urlHost + "/";
    final HttpClient httpClient = new HttpClient(testServer + "stendhal.version");
    final String version = httpClient.fetchFirstLine();
    if (version != null) {
      if (!Version.checkCompatibility(version, stendhal.VERSION)) {
        // custom title, warning icon
        JOptionPane.showMessageDialog(
            StendhalFirstScreen.get(),
View Full Code Here

TOP

Related Classes of games.stendhal.client.update.HttpClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.