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