2 * JCarder -- cards Java programs to keep threads disentangled
4 * Copyright (C) 2006-2007 Enea AB
5 * Copyright (C) 2007 Ulrik Svensson
6 * Copyright (C) 2007 Joel Rosdahl
8 * This program is made available under the GNU GPL version 2, with a special
9 * exception for linking with JUnit. See the accompanying file LICENSE.txt for
12 * This program is distributed in the hope that it will be useful, but WITHOUT
13 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 * FITNESS FOR A PARTICULAR PURPOSE.
17 package com.enea.jcarder.util;
19 import java.io.IOException;
20 import java.util.Properties;
22 public final class BuildInformation {
24 private BuildInformation() { }
26 public static String getShortInfo() {
28 Properties props = loadBuildProperties();
30 + props.getProperty("build.version")
32 + props.getProperty("build.number")
34 } catch (IOException e) {
40 public static void printLongBuildInformation() {
43 props = loadBuildProperties();
44 } catch (IOException e) {
48 StringBuffer sb = new StringBuffer();
49 sb.append("JCarder -- cards Java programs to keep threads"
51 sb.append("\nCopyright (C) 2006-2007 Enea AB\n");
52 sb.append("Copyright (C) 2007 Ulrik Svensson\n");
53 sb.append("Copyright (C) 2007 Joel Rosdahl\n");
54 sb.append("\nVersion: " + props.getProperty("build.version"));
55 sb.append("\nBuild : " + props.getProperty("build.number"));
56 sb.append("\nAt : " + props.getProperty("build.timestamp"));
57 sb.append("\nBy : " + props.getProperty("build.user.name"));
58 sb.append("\nOn : " + props.getProperty("build.os.name"));
59 System.out.println(sb.toString());
62 private static Properties loadBuildProperties() throws IOException {
63 Properties props = new Properties();
64 ClassLoader classLoader = ClassLoader.getSystemClassLoader();
65 props.load(classLoader.getResourceAsStream("build.properties"));