001: package org.tanukisoftware.wrapper;
002:
003: /*
004: * Copyright (c) 1999, 2006 Tanuki Software Inc.
005: *
006: * Permission is hereby granted, free of charge, to any person
007: * obtaining a copy of the Java Service Wrapper and associated
008: * documentation files (the "Software"), to deal in the Software
009: * without restriction, including without limitation the rights
010: * to use, copy, modify, merge, publish, distribute, sub-license,
011: * and/or sell copies of the Software, and to permit persons to
012: * whom the Software is furnished to do so, subject to the
013: * following conditions:
014: *
015: * The above copyright notice and this permission notice shall be
016: * included in all copies or substantial portions of the Software.
017: *
018: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
019: * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
020: * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
021: * NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
022: * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
023: * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
024: * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
025: * OTHER DEALINGS IN THE SOFTWARE.
026: *
027: *
028: * Portions of the Software have been derived from source code
029: * developed by Silver Egg Technology under the following license:
030: *
031: * Copyright (c) 2001 Silver Egg Technology
032: *
033: * Permission is hereby granted, free of charge, to any person
034: * obtaining a copy of this software and associated documentation
035: * files (the "Software"), to deal in the Software without
036: * restriction, including without limitation the rights to use,
037: * copy, modify, merge, publish, distribute, sub-license, and/or
038: * sell copies of the Software, and to permit persons to whom the
039: * Software is furnished to do so, subject to the following
040: * conditions:
041: *
042: * The above copyright notice and this permission notice shall be
043: * included in all copies or substantial portions of the Software.
044: */
045:
046: import java.util.Calendar;
047: import java.text.DateFormat;
048: import java.text.SimpleDateFormat;
049: import java.text.ParseException;
050:
051: /**
052: * WrapperInfo.java is build as part of the build process and should not be
053: * modified. Any changes to this class should be made to WrapperInfo.java.in
054: *
055: * @author Leif Mortenson <leif@tanukisoftware.com>
056: */
057: final class WrapperInfo {
058: /** Version of the Wrapper. */
059: private static final String m_version = "3.2.3";
060:
061: /** Date that the Wrapper was built. */
062: private static final Calendar m_build = Calendar.getInstance();
063:
064: /** Static initializer to create the build calendar from info hardcoded
065: * during the build. */
066: static {
067: Calendar buildDate = Calendar.getInstance();
068: Calendar buildTime = Calendar.getInstance();
069: try {
070: buildDate.setTime(new SimpleDateFormat("yyyyMMdd")
071: .parse("20061017"));
072: buildTime.setTime(new SimpleDateFormat("HHmm")
073: .parse("2319"));
074:
075: m_build.set(buildDate.get(Calendar.YEAR), buildDate
076: .get(Calendar.MONTH), buildDate.get(Calendar.DATE),
077: buildTime.get(Calendar.HOUR_OF_DAY), buildTime
078: .get(Calendar.MINUTE));
079:
080: } catch (ParseException e) {
081: System.out.println("Can not parse build date: "
082: + e.getMessage());
083: }
084: }
085:
086: /**
087: * Returns the version of the Wrapper.
088: *
089: * @return the version of the Wrapper.
090: */
091: static String getVersion() {
092: return m_version;
093: }
094:
095: /**
096: * Returns the time that the Wrapper was built.
097: *
098: * @return The time that the Wrapper was built.
099: */
100: static String getBuildTime() {
101: DateFormat df = new SimpleDateFormat("HH:mm zz MMM d, yyyy");
102: return df.format(m_build.getTime());
103: }
104:
105: /*---------------------------------------------------------------
106: * Constructors
107: *-------------------------------------------------------------*/
108: /**
109: * Can not be instantiated.
110: */
111: private WrapperInfo() {
112: }
113: }
|