1 10 package org.mmbase; 11 12 import java.io.*; 13 14 22 public class Version { 23 24 29 public static String getName() { 30 return "MMBase"; 31 } 32 33 38 public static int getMajor() { 39 return 1; 40 } 41 46 public static int getMinor() { 47 return 8; 48 } 49 50 55 public static int getPatchLevel() { 56 return 3; 57 } 58 59 66 public static String getBuildDate() { 67 String resource = ""; 68 InputStream builddate = Version.class.getResourceAsStream("builddate.properties"); 69 if (builddate != null) { 70 try { 71 BufferedReader buffer = new BufferedReader(new InputStreamReader(builddate)); 72 resource = buffer.readLine(); 73 buffer.close(); 74 } catch (IOException e) { 75 resource = "" + e; 77 } 78 } 79 return resource; 80 } 81 82 87 public static String getNumber() { 88 return getMajor() + "." + getMinor() + "." + getPatchLevel() + (isRelease() ? "-" + getReleaseStatus() + " " : ".") + getBuildDate(); 89 } 90 91 96 public static boolean isRelease() { 97 return true; 98 }; 99 100 105 public static String getReleaseStatus() { 106 return "final"; 107 }; 108 109 114 public static String get() { 115 return getName() + " " + getNumber(); 116 } 117 118 119 126 public static void main(String args[]) { 127 System.out.println(get()); 128 } 129 130 } 131 | Popular Tags |