Jump to content

Version Checker! [GREAT FOR LOCAL SCRIPTS!]


Reid

Recommended Posts

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 by PurpleKush
  • Like 2
Link to comment
Share on other sites

  • 1 month later...
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...