2 * @(#)VersionInfo.java 1.0 6/29/2001
4 * Copyright (c) 2001 International Business Machines Corp.
7 * This software has been released under the terms of the IBM Public
8 * License. For details, see the LICENSE file in the top-level source
9 * directory or online at http://www.openafs.org/dl/license10.html
11 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
12 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
13 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
14 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
15 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
16 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
17 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
18 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
19 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
20 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 package org.openafs.jafs;
26 import java.util.Date;
29 * Class providing static methods for retrieving version information specific to
33 * <!--Example of how to use class-->
34 * The following is a simple example of how to use the
35 * <code>VersionInfo</code> class.
37 * import org.openafs.jafs.VersionInfo;
42 * public static void main(String[] args) throws Exception
44 * System.out.println("Attributes of the jafs native library:");
45 * System.out.println("\tDescription:\t" + VersionInfo.getDescription());
46 * System.out.println("\tCompile Date:\t" + VersionInfo.getCompileDate());
47 * System.out.println("\tVersion Number:\t" + VersionInfo.getBuildNumber());
54 public final class VersionInfo
56 /*-------------------------------------------------------------------------*/
58 // No constructors, this is strictly a static class
60 /*-------------------------------------------------------------------------*/
63 ///////////////// accessors ///////////////////////
66 * Returns the date, in the form of a {@link java.util.Date} object,
67 * representing the compile-time of the native library.
70 * @exception Exception If an error occurs in the native code
72 public static final Date getBuildDate() throws Exception
74 return new Date(getBuildTime());
78 * Returns the version, in the form of "<version number>.<build number>",
79 * representing the full version and build revision of the native library.
82 * @see #getBuildNumber()
83 * @exception Exception If an error occurs in the native code
85 public static final String getFullVersion() throws Exception
87 return getVersion() + "." + getBuildNumber();
90 /////////////// native methods ////////////////////
93 * Returns the date, in the form of a long value of milliseconds since
94 * "epoch", representing the compile-time of the native library.
97 * @exception Exception If an error occurs in the native code
99 protected static final native long getBuildTime() throws Exception;
102 * Returns the compile-time description of the native library.
104 * @exception Exception If an error occurs in the native code
106 public static final native String getDescription() throws Exception;
109 * Returns the build number of the native library.
111 * @exception Exception If an error occurs in the native code
113 public static final native int getBuildNumber() throws Exception;
116 * Returns the version number of the native library.
118 * @exception Exception If an error occurs in the native code
120 public static final native String getVersion() throws Exception;
123 * Returns the description of the platform that built the native library.
125 * @exception Exception If an error occurs in the native code
127 public static final native String getBuildPlatform() throws Exception;