Info.java revision 368
230N/A/*
230N/A * CDDL HEADER START
230N/A *
230N/A * The contents of this file are subject to the terms of the
230N/A * Common Development and Distribution License (the "License").
230N/A * You may not use this file except in compliance with the License.
230N/A *
230N/A * See LICENSE.txt included in this distribution for the specific
230N/A * language governing permissions and limitations under the License.
230N/A *
230N/A * When distributing Covered Code, include this CDDL HEADER in each
230N/A * file and include the License file at LICENSE.txt.
230N/A * If applicable, add the following below this CDDL HEADER, with the
230N/A * fields enclosed by brackets "[]" replaced with your own identifying
230N/A * information: Portions Copyright [yyyy] [name of copyright owner]
230N/A *
230N/A * CDDL HEADER END
230N/A */
230N/A
230N/A/*
230N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
230N/A * Use is subject to license terms.
230N/A */
230N/Apackage org.opensolaris.opengrok;
230N/A
230N/Aimport java.io.IOException;
230N/Aimport java.io.InputStream;
230N/Aimport java.util.Properties;
230N/A
230N/A/**
230N/A * Utility class to get information of the OpenGrok version.
230N/A *
230N/A * @author Trond Norbye
230N/A */
230N/Apublic class Info {
230N/A private static final Properties properties = new Properties();
230N/A
368N/A private static final String VERSION;
368N/A private static final String REVISION;
340N/A
230N/A static {
230N/A try {
230N/A InputStream in = Info.class.getResourceAsStream("info.properties");
230N/A if (in != null) {
230N/A properties.load(in);
230N/A }
340N/A VERSION = properties.getProperty("version", "unknown");
340N/A REVISION = properties.getProperty("changeset", "unknown");
230N/A } catch (IOException ioe) {
230N/A throw new RuntimeException(ioe);
230N/A }
230N/A }
230N/A
230N/A public static String getVersion() {
340N/A return VERSION;
340N/A }
340N/A
340N/A public static String getFullVersion() {
340N/A return "OpenGrok v" + VERSION + " rev " + REVISION;
230N/A }
230N/A
230N/A public static String getRevision() {
340N/A return REVISION;
230N/A }
230N/A
230N/A private Info() {
230N/A }
230N/A}