Package xnap.net

Examples of xnap.net.HttpConnection


        public void actionPerformed(ActionEvent event)
  {
      PluginInfo i = (PluginInfo)jlPlugins.getSelectedValue();

      try {
    HttpConnection c = new HttpConnection();
    c.connect(i.getLocation());

    ProgressMonitorInputStream pIn = new ProgressMonitorInputStream
      (PluginDialog.this, "Downloading " + i.getFilename(),
       c.getInputStream());
    pIn.getProgressMonitor().setMillisToPopup(0);
    pIn.getProgressMonitor().setMillisToDecideToPopup(0);
    InputStream in = new BufferedInputStream(pIn);
    String f = FileHelper.getHomeDir("jars") + i.getFilename();
View Full Code Here


  boolean showUpdate = false;
 
  prefs.setLastUpdateCheck(System.currentTimeMillis());
  prefs.write();
     
  HttpConnection conn = new HttpConnection();
  try {
      conn.connect(prefs.getUpdateURL());
     
      String line = conn.nextLine();
      if (line != null) {
    StringTokenizer t = new StringTokenizer(line, " ");
   
    if (t.hasMoreTokens()) {
        currentVersion = t.nextToken();
    }

    if (t.hasMoreTokens()) {
        try {
      currentReleaseNr = Long.parseLong(t.nextToken());
        }
        catch (NumberFormatException e) {
        }
    }

    showUpdate = (currentReleaseNr > XNap.RELEASE_NR);
      }
     
      StringBuffer sb = new StringBuffer();
      String s;
      while ((s = conn.nextLine()) != null) {
    sb.append(s);
    sb.append("\n");
      }
      info = sb.toString();

      return showUpdate;
  }
  catch (IOException e) {
      throw(e);
  }
  finally {
      conn.close();
  }
    }
View Full Code Here

  return currentVersion;
    }

    public InputStream connect() throws IOException
    {
  HttpConnection conn = new HttpConnection();
  conn.connect(prefs.getXNapJarURL());
  return conn.getInputStream();
    }
View Full Code Here

TOP

Related Classes of xnap.net.HttpConnection

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.