KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > impl > tools > sysinfo > ZipInfoProperties


1 /*
2
3    Derby - Class org.apache.derby.impl.tools.sysinfo.ZipInfoProperties
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (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

24 package org.apache.derby.impl.tools.sysinfo;
25
26 import java.util.Properties JavaDoc;
27 import java.io.OutputStream JavaDoc;
28 import org.apache.derby.iapi.services.info.PropertyNames;
29 import org.apache.derby.iapi.services.info.ProductVersionHolder;
30
31 public class ZipInfoProperties // extends Properties
32
{
33     private final ProductVersionHolder version;
34     /**
35         full path to zip (or expanded zip)
36         C:/cloudscape/lib/tools.zip
37             -or-
38         D:\myWorkDir\cloudscape\lib\ *expanded*
39
40         The base name (at the end) should be the same as the zipNameString
41      */

42     private String JavaDoc location;
43
44     ZipInfoProperties(ProductVersionHolder version) {
45         this.version = version;
46     }
47
48     /**
49         Method to get only the "interesting" pieces of information
50         for the customer, namely the version number (2.0.1) and
51         the beta status and the build number
52         @return a value for displaying to the user via Sysinfo
53     */

54     public String JavaDoc getVersionBuildInfo()
55     {
56         if (version == null)
57         {
58             return Main.getTextMessage ("SIF04.C");
59         }
60
61         if ("DRDA:jcc".equals(version.getProductTechnologyName()))
62             return version.getSimpleVersionString() + " - (" + version.getBuildNumber() + ")";
63
64         return version.getVersionBuildString(true);
65
66     }
67
68     public String JavaDoc getLocation()
69     {
70         if (location == null)
71             return Main.getTextMessage ("SIF01.H");
72         return location;
73     }
74
75     void setLocation(String JavaDoc location) {
76         this.location = location;
77     }
78
79
80
81 }
82
83
84
Popular Tags