diff -r d8ab8aece6f2 -r 7900bb1666f6 java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java --- a/java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java Mon Dec 16 20:20:54 2013 +0100 +++ b/java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java Mon Dec 16 20:39:07 2013 +0100 @@ -52,13 +52,13 @@ println("TODO: show some help"); break; case LICENSE: - printLicense(); + printResource(Constants.LICENSE_FILE); break; case TYPES: println("TODO: list supported types"); break; case VERSION: - println("TODO: show version"); + printResource(Constants.VERSION_FILE); break; case DATABASES: println("TODO: list databases"); @@ -72,10 +72,10 @@ } } - private void printLicense() { - try (BufferedReader license = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("info/globalcode/sql/dk/license.txt")))) { + private void printResource(String fileName) { + try (BufferedReader reader = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream(fileName)))) { while (true) { - String line = license.readLine(); + String line = reader.readLine(); if (line == null) { break; } else { @@ -83,7 +83,7 @@ } } } catch (Exception e) { - log.log(Level.SEVERE, "Unable to print license. See our website for license information.", e); + log.log(Level.SEVERE, "Unable to print this info. Please see our website for it: " + Constants.WEBSITE, e); } }