001: package net.sourceforge.squirrel_sql.client;
002:
003: /*
004: * Copyright (C) 2001-2006 Colin Bell
005: * colbell@users.sourceforge.net
006: *
007: * This library is free software; you can redistribute it and/or
008: * modify it under the terms of the GNU Lesser General Public
009: * License as published by the Free Software Foundation; either
010: * version 2.1 of the License, or (at your option) any later version.
011: *
012: * This library is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015: * Lesser General Public License for more details.
016: *
017: * You should have received a copy of the GNU Lesser General Public
018: * License along with this library; if not, write to the Free Software
019: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
020: */
021: import net.sourceforge.squirrel_sql.fw.util.StringManager;
022: import net.sourceforge.squirrel_sql.fw.util.StringManagerFactory;
023:
024: /**
025: * Application version information.
026: *
027: * @author <A HREF="mailto:colbell@users.sourceforge.net">Colin Bell</A>
028: */
029: public class Version {
030: /** Internationalized strings for this class. */
031: private static final StringManager s_stringMgr = StringManagerFactory
032: .getStringManager(Version.class);
033:
034: private static final String APP_NAME = s_stringMgr
035: .getString("Version.appname");
036: private static final int MAJOR_VERSION = 2;
037: private static final int MINOR_VERSION = 6;
038: private static final int RELEASE = 5;
039: private static final String BUGFIX_VERSION = "a";
040:
041: private static final String COPYRIGHT = s_stringMgr
042: .getString("Version.copyright");
043:
044: private static final String WEB_SITE = s_stringMgr
045: .getString("Version.website");
046:
047: public static String getApplicationName() {
048: return APP_NAME;
049: }
050:
051: public static String getShortVersion() {
052: StringBuffer buf = new StringBuffer();
053: buf.append(MAJOR_VERSION).append(".").append(MINOR_VERSION);
054:
055: if (RELEASE != 0) {
056: buf.append(".");
057: buf.append(RELEASE);
058: }
059: buf.append(BUGFIX_VERSION);
060: return buf.toString();
061: }
062:
063: public static String getVersion() {
064: StringBuffer buf = new StringBuffer();
065: buf.append(APP_NAME).append(" Version ").append(
066: getShortVersion());
067: return buf.toString();
068: }
069:
070: public static String getCopyrightStatement() {
071: return COPYRIGHT;
072: }
073:
074: public static String getWebSite() {
075: return WEB_SITE;
076: }
077:
078: public static boolean supportsUsedJDK() {
079: String vmVer = System.getProperty("java.vm.version");
080:
081: if (vmVer.startsWith("0") || vmVer.startsWith("1.0")
082: || vmVer.startsWith("1.1") || vmVer.startsWith("1.2")
083: || vmVer.startsWith("1.3") || vmVer.startsWith("1.4")) {
084: return false;
085: } else {
086: return true;
087: }
088: }
089:
090: public static String getUnsupportedJDKMessage() {
091: String[] params = new String[] {
092: System.getProperty("java.vm.version"),
093: System.getProperty("java.home") };
094:
095: return s_stringMgr.getString(
096: "Application.error.unsupportedJDKVersion", params);
097: }
098:
099: public static boolean isJDK14() {
100: String vmVer = System.getProperty("java.vm.version");
101:
102: if (vmVer.startsWith("1.4")) {
103: return true;
104: } else {
105: return false;
106: }
107: }
108:
109: public static boolean isJDK16OrAbove() {
110: String vmVer = System.getProperty("java.vm.version").substring(
111: 0, 3);
112:
113: if (vmVer.compareTo("1.6") >= 0) {
114: return true;
115: } else {
116: return false;
117: }
118: }
119:
120: }
|