Solved Downloading webpage

Discussion in 'Plugin Development' started by storm345(forums), Feb 21, 2013.

Thread Status:
Not open for further replies.
  1. Ok, in my plugin, useful, there is an autoupdater. It has worked fine so far. But out of the blue it stopped working. I have checked it again and again and the code it downloads of the plugin webpage (http://dev.bukkit.org/server-mods/useful) is different to that of the source. I have no idea why this is as it worked perfectly before and the code for the plugin page IS the same (I checked for HOURS).
    To load the page:
    Code:
    BufferedReader buff;
                                  InputStreamReader inStream;
                                  String htmlCode = null;
                                  String latestFilePage = "";
                                  try{
                                      URL bukkiturl = new URL("http://dev.bukkit.org/server-mods/useful");
                                      HttpURLConnection urlConnection = (HttpURLConnection)bukkiturl.openConnection();
                                      urlConnection.setRequestMethod("GET");
                                      urlConnection.setUseCaches(false);
                                      urlConnection.setReadTimeout(15*1000);
                                      urlConnection.connect();
                                      inStream = new InputStreamReader(urlConnection.getInputStream());
                                      buff = new BufferedReader(inStream);
    Following this I simply have been writing it to a file to try and find out what went wrong but it DOESN'T match the source code for the actual webpage. It needs to for the autoupdater. If anyone can solve this PLEASE tell me! This is weird? If you need anymore code visit the github page (https://www.github.com/storm345/useful)
     
  2. Offline

    Mango

  3. Thanks, it works. Although I still don't understand what was wrong with my code as it worked before? Nevertheless thank you!
     
Thread Status:
Not open for further replies.

Share This Page