public synchronized void downloadLatestVersion ()
      {
        FileOutputStream fos = null;
        try
          {
            if (remoteVersion == null)
              {
                this.updateCheck();
              }
            plugin.getLogger().info("Downloading latest version...");
            ReadableByteChannel rbc =
                Channels.newChannel(new URL(downloadUrl.replace("{version}",
                    remoteVersion)).openStream());
            fos =
                new FileOutputStream("plugins" + File.separator + pluginName
                    + ".jar");
            fos.getChannel().transferFrom(rbc, 0, 1 << 24);
          }
        catch (MalformedURLException e)
          {
            e.printStackTrace();
          }
        catch (IOException e)
          {
            e.printStackTrace();
          }
        finally
          {
            if (fos != null)
              {
                try
                  {
                    fos.close();
                    plugin.getLogger().info(
                        "Latest version has finished downloading");
                    plugin.getLogger().info(
                        "Changes will take effect on restart");
                  }
                catch (IOException e)
                  {
                    e.printStackTrace();
                  }
              }
            downloaded.set(true);
          }
      }