Reid Posted March 15, 2014 Share Posted March 15, 2014 (edited) Checks if script version is up to date via a text file located online! /** * @author Reid (PurpleKush) * @param currentVersion * @param txtLocation * @return up to date or not * @throws IOException */ public static boolean versionCheck(final double currentVersion,final String txtLocation) throws IOException { final URL url = new URL(txtLocation); final BufferedReader file = new BufferedReader(new InputStreamReader(url.openStream())); final String onlineVersion = file.readLine(); file.close(); return Double.parseDouble(onlineVersion) == currentVersion; } Edited March 15, 2014 by PurpleKush 2 Link to comment Share on other sites More sharing options...
Joseph Posted March 15, 2014 Share Posted March 15, 2014 what website would you use? i appreciate the snippet 1 Link to comment Share on other sites More sharing options...
Reid Posted March 15, 2014 Author Share Posted March 15, 2014 I'd suggest dropbox 100% uptime 1 Link to comment Share on other sites More sharing options...
Joseph Posted March 15, 2014 Share Posted March 15, 2014 Thats what i had in mind 1 Link to comment Share on other sites More sharing options...
Extreme Scripts Posted May 2, 2014 Share Posted May 2, 2014 Just a suggestion but maybe improve it so instead of returning true/false it actually returns the online version if false so it can be printed on the paint for the end-users knowledge ^_^ 1 Link to comment Share on other sites More sharing options...