0

I have a game client jar that has an updater. Its client.jar and it downloads a cache which has all the game files. There is no need to update the client.jar just the cache, but the problem is the version number is hardcoded into the client.

What I've been trying to do ALL day is change the way the version number is obtained, and I just can't get it.

http://pastebin.com/Z5urTUVw

Line 31 is the version number, I need that to read a version number from a dropbox link. Found here - https://dl.dropboxusercontent.com/u/87363031/version.txt

Just 1 simple number, I've been trying to do this for the better part of 6 hours now and I'm bout to lose my cool. Can someone please help me with this?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
VirtualJunky
  • 81
  • 1
  • 7
  • Where exactly are you stuck??? Are you not able to make a http connection to that file url??? If so, put that part of code here... – Codebender Jun 17 '15 at 04:14

1 Answers1

0

If you can use Apache Commons IO, there's a very simple way to achieve this using IOUtils:

InputStream in = new URL("https://dl.dropboxusercontent.com/u/87363031/version.txt").openStream();
try {
   String version = IOUtils.toString(in));
   System.out.println(version);
} finally {
   IOUtils.closeQuietly(in);
}
Val
  • 207,596
  • 13
  • 358
  • 360