comparison src/ch/ethz/ssh2/Version.java @ 308:42b15aaa7ac7 ganymed

merge
author Carl Byington <carl@five-ten-sg.com>
date Wed, 30 Jul 2014 14:21:50 -0700
parents 071eccdff8ea
children
comparison
equal deleted inserted replaced
306:90e47d99ea54 308:42b15aaa7ac7
3 /** 3 /**
4 * Provides version information from the manifest. 4 * Provides version information from the manifest.
5 * 5 *
6 * @version $Id: Version.java 140 2014-04-15 13:16:25Z dkocher@sudo.ch $ 6 * @version $Id: Version.java 140 2014-04-15 13:16:25Z dkocher@sudo.ch $
7 */ 7 */
8 public class Version 8 public class Version {
9 { 9 public static String getSpecification() {
10 public static String getSpecification() 10 Package pkg = Version.class.getPackage();
11 {
12 Package pkg = Version.class.getPackage();
13 return (pkg == null) ? "SNAPSHOT" : pkg.getSpecificationVersion() == null ? "SNAPSHOT" : pkg.getSpecificationVersion(); 11 return (pkg == null) ? "SNAPSHOT" : pkg.getSpecificationVersion() == null ? "SNAPSHOT" : pkg.getSpecificationVersion();
14 } 12 }
15 13
16 public static String getImplementation() 14 public static String getImplementation() {
17 { 15 Package pkg = Version.class.getPackage();
18 Package pkg = Version.class.getPackage();
19 return (pkg == null) ? "SNAPSHOT" : pkg.getImplementationVersion() == null ? "SNAPSHOT" : pkg.getImplementationVersion(); 16 return (pkg == null) ? "SNAPSHOT" : pkg.getImplementationVersion() == null ? "SNAPSHOT" : pkg.getImplementationVersion();
20 } 17 }
21 18
22 /** 19 /**
23 * A simple main method that prints the version and exits 20 * A simple main method that prints the version and exits
24 */ 21 */
25 public static void main(String[] args) 22 public static void main(String[] args) {
26 { 23 System.out.println("Version: " + getSpecification());
27 System.out.println("Version: " + getSpecification()); 24 System.out.println("Implementation: " + getImplementation());
28 System.out.println("Implementation: " + getImplementation()); 25 }
29 }
30 } 26 }