01: /*
02:
03: Derby - Class org.apache.derby.impl.tools.sysinfo.ZipInfoProperties
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to you under the Apache License, Version 2.0
09: (the "License"); you may not use this file except in compliance with
10: the License. You may obtain a copy of the License at
11:
12: http://www.apache.org/licenses/LICENSE-2.0
13:
14: Unless required by applicable law or agreed to in writing, software
15: distributed under the License is distributed on an "AS IS" BASIS,
16: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: See the License for the specific language governing permissions and
18: limitations under the License.
19:
20: */
21:
22: //ZipInfoProperties
23: package org.apache.derby.impl.tools.sysinfo;
24:
25: import java.util.Properties;
26: import java.io.OutputStream;
27: import org.apache.derby.iapi.services.info.PropertyNames;
28: import org.apache.derby.iapi.services.info.ProductVersionHolder;
29:
30: public class ZipInfoProperties // extends Properties
31: {
32: private final ProductVersionHolder version;
33: /**
34: full path to zip (or expanded zip)
35: C:/cloudscape/lib/tools.zip
36: -or-
37: D:\myWorkDir\cloudscape\lib\ *expanded*
38:
39: The base name (at the end) should be the same as the zipNameString
40: */
41: private String location;
42:
43: ZipInfoProperties(ProductVersionHolder version) {
44: this .version = version;
45: }
46:
47: /**
48: Method to get only the "interesting" pieces of information
49: for the customer, namely the version number (2.0.1) and
50: the beta status and the build number
51: @return a value for displaying to the user via Sysinfo
52: */
53: public String getVersionBuildInfo() {
54: if (version == null) {
55: return Main.getTextMessage("SIF04.C");
56: }
57:
58: if ("DRDA:jcc".equals(version.getProductTechnologyName()))
59: return version.getSimpleVersionString() + " - ("
60: + version.getBuildNumber() + ")";
61:
62: return version.getVersionBuildString(true);
63:
64: }
65:
66: public String getLocation() {
67: if (location == null)
68: return Main.getTextMessage("SIF01.H");
69: return location;
70: }
71:
72: void setLocation(String location) {
73: this.location = location;
74: }
75:
76: }
|