java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java
branchv_0
changeset 18 7900bb1666f6
parent 17 d8ab8aece6f2
child 19 873669135d97
     1.1 --- a/java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java	Mon Dec 16 20:20:54 2013 +0100
     1.2 +++ b/java/sql-dk/src/info/globalcode/sql/dk/InfoLister.java	Mon Dec 16 20:39:07 2013 +0100
     1.3 @@ -52,13 +52,13 @@
     1.4  					println("TODO: show some help");
     1.5  					break;
     1.6  				case LICENSE:
     1.7 -					printLicense();
     1.8 +					printResource(Constants.LICENSE_FILE);
     1.9  					break;
    1.10  				case TYPES:
    1.11  					println("TODO: list supported types");
    1.12  					break;
    1.13  				case VERSION:
    1.14 -					println("TODO: show version");
    1.15 +					printResource(Constants.VERSION_FILE);
    1.16  					break;
    1.17  				case DATABASES:
    1.18  					println("TODO: list databases");
    1.19 @@ -72,10 +72,10 @@
    1.20  		}
    1.21  	}
    1.22  
    1.23 -	private void printLicense() {
    1.24 -		try (BufferedReader license = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream("info/globalcode/sql/dk/license.txt")))) {
    1.25 +	private void printResource(String fileName) {
    1.26 +		try (BufferedReader reader = new BufferedReader(new InputStreamReader(getClass().getClassLoader().getResourceAsStream(fileName)))) {
    1.27  			while (true) {
    1.28 -				String line = license.readLine();
    1.29 +				String line = reader.readLine();
    1.30  				if (line == null) {
    1.31  					break;
    1.32  				} else {
    1.33 @@ -83,7 +83,7 @@
    1.34  				}
    1.35  			}
    1.36  		} catch (Exception e) {
    1.37 -			log.log(Level.SEVERE, "Unable to print license. See our website for license information.", e);
    1.38 +			log.log(Level.SEVERE, "Unable to print this info. Please see our website for it: " + Constants.WEBSITE, e);
    1.39  		}
    1.40  	}
    1.41