aboutsummaryrefslogtreecommitdiffstats
path: root/src/resources
diff options
context:
space:
mode:
authorNick Burch <nick@apache.org>2008-07-12 19:37:17 +0000
committerNick Burch <nick@apache.org>2008-07-12 19:37:17 +0000
commitc96a30340dc04af14d2137fa29658afa33e01606 (patch)
tree0897ff42c3a556beb602dd3261341680fbb12fe4 /src/resources
parentbd8c0df8fb49c1cfe864998a76e4311440f8a0c7 (diff)
downloadpoi-c96a30340dc04af14d2137fa29658afa33e01606.tar.gz
poi-c96a30340dc04af14d2137fa29658afa33e01606.zip
Implement idea from bug #35583 - Include a version class, org.apache.poi.Version, to allow easy introspection of the POI version
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@676221 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/version/Version.java.template69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/resources/version/Version.java.template b/src/resources/version/Version.java.template
new file mode 100644
index 0000000000..716ec916bf
--- /dev/null
+++ b/src/resources/version/Version.java.template
@@ -0,0 +1,69 @@
+/* ====================================================================
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+==================================================================== */
+
+package org.apache.poi;
+
+/**
+ * Administrative class to keep track of the version number of the
+ * POI release.
+ *
+ * This class implements the upcoming standard of having
+ * org.apache.project-name.Version.getVersion() be a standard
+ * way to get version information.
+ */
+public class Version {
+ private static final String VERSION_STRING = "@VERSION@";
+ private static final String RELEASE_DATE = "@DSTAMP@";
+
+ /**
+ * Return the basic version string, of the form
+ * nn.nn(.nn)
+ */
+ public static String getVersion() {
+ return VERSION_STRING;
+ }
+
+ /**
+ * Return the date of the release / build
+ */
+ public static String getReleaseDate() {
+ return RELEASE_DATE;
+ }
+
+ /**
+ * Name of product: POI
+ */
+ public static String getProduct() {
+ return "POI";
+ }
+ /**
+ * Implementation Language: Java
+ */
+ public static String getImplementationLanguage() {
+ return "Java";
+ }
+
+ /**
+ * Prints the version to the command line
+ */
+ public static void main(String[] args) {
+ System.out.println(
+ "Apache " + getProduct() + " " +
+ getVersion() + " (" + getReleaseDate() + ")"
+ );
+ }
+}