@org.junit.Ignore @Test public void testGetLatestVersion() { System.out.println(VersionUtils.getLatestVersion()); }
public static String getLatestVersion() { BufferedReader br = null; try { URL url = new URL(UPDATE_URL); URLConnection conn = url.openConnection(); br = new BufferedReader(new InputStreamReader(conn.getInputStream())); return br.readLine(); } catch (MalformedURLException e) { throw new VersionException(e); } catch (IOException e) { throw new VersionException(e); } finally { if (br != null) { try { br.close(); } catch (IOException e) { throw new VersionException(e); } } } }
VersionUtils { public static String getLatestVersion() { BufferedReader br = null; try { URL url = new URL(UPDATE_URL); URLConnection conn = url.openConnection(); br = new BufferedReader(new InputStreamReader(conn.getInputStream())); return br.readLine(); } catch (MalformedURLException e) { throw new VersionException(e); } catch (IOException e) { throw new VersionException(e); } finally { if (br != null) { try { br.close(); } catch (IOException e) { throw new VersionException(e); } } } } }
VersionUtils { public static String getLatestVersion() { BufferedReader br = null; try { URL url = new URL(UPDATE_URL); URLConnection conn = url.openConnection(); br = new BufferedReader(new InputStreamReader(conn.getInputStream())); return br.readLine(); } catch (MalformedURLException e) { throw new VersionException(e); } catch (IOException e) { throw new VersionException(e); } finally { if (br != null) { try { br.close(); } catch (IOException e) { throw new VersionException(e); } } } } private  VersionUtils(); }
VersionUtils { public static String getLatestVersion() { BufferedReader br = null; try { URL url = new URL(UPDATE_URL); URLConnection conn = url.openConnection(); br = new BufferedReader(new InputStreamReader(conn.getInputStream())); return br.readLine(); } catch (MalformedURLException e) { throw new VersionException(e); } catch (IOException e) { throw new VersionException(e); } finally { if (br != null) { try { br.close(); } catch (IOException e) { throw new VersionException(e); } } } } private  VersionUtils(); static String getLatestVersion(); static int compare(String version1, String version2); }
VersionUtils { public static String getLatestVersion() { BufferedReader br = null; try { URL url = new URL(UPDATE_URL); URLConnection conn = url.openConnection(); br = new BufferedReader(new InputStreamReader(conn.getInputStream())); return br.readLine(); } catch (MalformedURLException e) { throw new VersionException(e); } catch (IOException e) { throw new VersionException(e); } finally { if (br != null) { try { br.close(); } catch (IOException e) { throw new VersionException(e); } } } } private  VersionUtils(); static String getLatestVersion(); static int compare(String version1, String version2);  }