01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: Version.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife;
09:
10: import com.uwyn.rife.resources.ResourceFinderClasspath;
11: import com.uwyn.rife.resources.exceptions.ResourceFinderErrorException;
12:
13: public class Version {
14: private String mVersion = null;
15:
16: Version() {
17: ResourceFinderClasspath resource_finder = ResourceFinderClasspath
18: .getInstance();
19: try {
20: mVersion = resource_finder.getContent("RIFE_VERSION");
21: } catch (ResourceFinderErrorException e) {
22: mVersion = null;
23: }
24:
25: if (mVersion != null) {
26: mVersion = mVersion.trim();
27: }
28: if (null == mVersion) {
29: mVersion = "unknown version";
30: }
31: }
32:
33: private String getVersionString() {
34: return mVersion;
35: }
36:
37: public static String getVersion() {
38: return VersionSingleton.INSTANCE.getVersionString();
39: }
40: }
|