2 * @(#)VersionInfo.java 1.0 05/09/2005
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
;
27 * Provides version information about the native C library and the JAVA side.
29 * At least a <<Class.forName("org.openafs.jafs.Token");>> is necessary before using these methods.
30 * Perhaps a redesign would be required because the library initialization occures only in Token.java.
32 public class VersionInfo
35 * Returns java interface version string
36 * the native library version should be higher
38 public static String
getVersionOfJavaInterface() {return "20050905";}
41 * Returns the native library version
43 * @exception AFSException if internal (libjafs, libjafsadmin) versions differ
45 public static String
getVersionOfLibrary() throws AFSException
47 String ver
= getVersionOfLibjafs();
48 if (!ver
.equals(getVersionOfLibjafsadm()))
49 throw new AFSException("library versions differ", 0);
54 * Returns build information of the native library.
55 * This information is autogenerated by the openafs make system.
56 * Example: "@(#) OpenAFS 1.3.87 built 2005-09-06 "
58 * @exception AFSException if internal (libjafs, libjafsadmin) versions differ
60 public static String
getBuildInfo() throws AFSException
62 String info
= getBuildInfoOfLibjafs();
63 if (!info
.equals(getBuildInfoOfLibjafsadm()))
64 throw new AFSException("library build info differ", 0);
68 private static native String
getVersionOfLibjafs();
69 private static native String
getVersionOfLibjafsadm();
70 private static native String
getBuildInfoOfLibjafs();
71 private static native String
getBuildInfoOfLibjafsadm();