KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > izforge > izpack > Info


1 /*
2  * $Id: Info.java 1708 2007-01-13 18:31:26Z jponge $
3  * IzPack - Copyright 2001-2007 Julien Ponge, All Rights Reserved.
4  *
5  * http://www.izforge.com/izpack/
6  * http://developer.berlios.de/projects/izpack/
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * 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 package com.izforge.izpack;
22
23 import java.io.Serializable JavaDoc;
24 import java.util.ArrayList JavaDoc;
25
26 /**
27  * Contains some informations for an installer, as defined in the <info> section of the XML files.
28  *
29  * @author Julien Ponge
30  */

31 public class Info implements Serializable JavaDoc
32 {
33
34     static final long serialVersionUID = 13288410782044775L;
35
36     /** The application name and version */
37     private String JavaDoc appName = "";
38     private String JavaDoc appVersion = "";
39
40     /** The installation subpath */
41     private String JavaDoc installationSubPath = null;
42
43     /** The application authors */
44     private ArrayList JavaDoc authors = new ArrayList JavaDoc();
45
46     /** The application URL */
47     private String JavaDoc appURL = null;
48
49     /** The required Java version (min) */
50     private String JavaDoc javaVersion = "1.2";
51
52     /** The name of the installer file (name without jar suffix) */
53     private String JavaDoc installerBase = null;
54
55     /** The application Web Directory URL */
56     private String JavaDoc webDirURL = null;
57
58     /** The uninstaller name */
59     private String JavaDoc uninstallerName = "uninstaller.jar";
60
61     /** The path of the summary log file */
62     private String JavaDoc summaryLogFilePath = "$INSTALL_PATH/Uninstaller/InstallSummary.htm";
63
64     /** The full qualified name of the class which should be
65      * used for decoding the packs.
66      */

67     private String JavaDoc packDecoderClassName = null;
68     
69     private String JavaDoc unpackerClassName = null;
70     
71     /** The constructor, deliberatly void. */
72     public Info()
73     {
74     }
75
76     /**
77      * Sets the application name.
78      *
79      * @param appName The new application name.
80      */

81     public void setAppName(String JavaDoc appName)
82     {
83         this.appName = appName;
84     }
85
86     /**
87      * Gets the application name.
88      *
89      * @return The application name.
90      */

91     public String JavaDoc getAppName()
92     {
93         return appName;
94     }
95
96     /**
97      * Sets the version.
98      *
99      * @param appVersion The application version.
100      */

101     public void setAppVersion(String JavaDoc appVersion)
102     {
103         this.appVersion = appVersion;
104     }
105
106     /**
107      * Gets the version.
108      *
109      * @return The application version.
110      */

111     public String JavaDoc getAppVersion()
112     {
113         return appVersion;
114     }
115
116     /**
117      * Adds an author to the authors list.
118      *
119      * @param author The author to add.
120      */

121     public void addAuthor(Author author)
122     {
123         authors.add(author);
124     }
125
126     /**
127      * Gets the authors list.
128      *
129      * @return The authors list.
130      */

131     public ArrayList JavaDoc getAuthors()
132     {
133         return authors;
134     }
135
136     /**
137      * Sets the application URL.
138      *
139      * @param appURL The application URL.
140      */

141     public void setAppURL(String JavaDoc appURL)
142     {
143         this.appURL = appURL;
144     }
145
146     /**
147      * Gets the application URL.
148      *
149      * @return The application URL.
150      */

151     public String JavaDoc getAppURL()
152     {
153         return appURL;
154     }
155
156     /**
157      * Sets the minimum Java version required.
158      *
159      * @param javaVersion The Java version.
160      */

161     public void setJavaVersion(String JavaDoc javaVersion)
162     {
163         this.javaVersion = javaVersion;
164     }
165
166     /**
167      * Gets the Java version required.
168      *
169      * @return The Java version.
170      */

171     public String JavaDoc getJavaVersion()
172     {
173         return javaVersion;
174     }
175
176     /**
177      * Sets the installer name.
178      *
179      * @param installerBase The new installer name.
180      */

181     public void setInstallerBase(String JavaDoc installerBase)
182     {
183         this.installerBase = installerBase;
184     }
185
186     /**
187      * Gets the installer name.
188      *
189      * @return The name of the installer file, without the jar suffix.
190      */

191     public String JavaDoc getInstallerBase()
192     {
193         return installerBase;
194     }
195
196     /**
197      * Sets the webDir URL.
198      *
199      * @param url The application URL.
200      */

201     public void setWebDirURL(String JavaDoc url)
202     {
203         this.webDirURL = url;
204     }
205
206     /**
207      * Gets the webDir URL if it has been specified
208      *
209      * @return The webDir URL from which the installer is retrieved, or <tt>null</tt> if non has
210      * been set.
211      */

212     public String JavaDoc getWebDirURL()
213     {
214         return webDirURL;
215     }
216
217     /**
218      * Sets the name of the uninstaller.
219      *
220      * @param name the name of the uninstaller.
221      */

222     public void setUninstallerName(String JavaDoc name)
223     {
224         this.uninstallerName = name;
225     }
226
227     /**
228      * Returns the name of the uninstaller.
229      *
230      * @return the name of the uninstaller.
231      */

232     public String JavaDoc getUninstallerName()
233     {
234         return this.uninstallerName;
235     }
236
237     /**
238      * This class represents an author.
239      *
240      * @author Julien Ponge
241      */

242     public static class Author implements Serializable JavaDoc
243     {
244
245         static final long serialVersionUID = -3090178155004960243L;
246
247         /** The author name */
248         private String JavaDoc name;
249
250         /** The author email */
251         private String JavaDoc email;
252
253         /**
254          * Gets the author name.
255          *
256          * @return The author name.
257          */

258         public String JavaDoc getName()
259         {
260             return name;
261         }
262
263         /**
264          * Gets the author email.
265          *
266          * @return The author email.
267          */

268         public String JavaDoc getEmail()
269         {
270             return email;
271         }
272
273         /**
274          * The constructor.
275          *
276          * @param name The author name.
277          * @param email The author email.
278          */

279         public Author(String JavaDoc name, String JavaDoc email)
280         {
281             this.name = name;
282             this.email = email;
283         }
284
285         /**
286          * Gets a String representation of the author.
287          *
288          * @return The String representation of the author, in the form : name <email> .
289          */

290         public String JavaDoc toString()
291         {
292             return name + " <" + email + ">";
293         }
294
295     }
296
297     /**
298      * Gets the installation subpath.
299      *
300      * @return the installation subpath
301      */

302     public String JavaDoc getInstallationSubPath()
303     {
304         return installationSubPath;
305     }
306
307     /**
308      * Sets the installation subpath.
309      *
310      * @param string subpath to be set
311      */

312     public void setInstallationSubPath(String JavaDoc string)
313     {
314         installationSubPath = string;
315     }
316
317     /**
318      * Returns the summary log file path.
319      *
320      * @return the summary log file path
321      */

322     public String JavaDoc getSummaryLogFilePath()
323     {
324         return summaryLogFilePath;
325     }
326
327     /**
328      * Sets the summary log file path.
329      *
330      * @param summaryLogFilePath the summary log file path to set
331      */

332     public void setSummaryLogFilePath(String JavaDoc summaryLogFilePath)
333     {
334         this.summaryLogFilePath = summaryLogFilePath;
335     }
336     /**
337      * Returns the full qualified class name of the class which
338      * should be used for decoding the packs.
339      * @return Returns the packDecoderClassName.
340      */

341     public String JavaDoc getPackDecoderClassName()
342     {
343         return packDecoderClassName;
344     }
345     /**
346      * Sets the full qualified class name of the class which
347      * should be used for decoding the packs.
348      * @param packDecoderClassName The packDecoderClassName to set.
349      */

350     public void setPackDecoderClassName(String JavaDoc packDecoderClassName)
351     {
352         this.packDecoderClassName = packDecoderClassName;
353     }
354
355     
356     public String JavaDoc getUnpackerClassName()
357     {
358         return unpackerClassName;
359     }
360
361     
362     public void setUnpackerClassName(String JavaDoc unpackerClassName)
363     {
364         this.unpackerClassName = unpackerClassName;
365     }
366 }
367
Popular Tags