Statistics
| Revision:

root / import / ext3D / trunk / install-extension3d / IzPack / src / lib / com / izforge / izpack / Info.java @ 15280

History | View | Annotate | Download (5.91 KB)

1
/*
2
 *  $Id: Info.java,v 1.1 2006/06/14 07:29:07 cesar Exp $
3
 *  IzPack
4
 *  Copyright (C) 2001-2004 Julien Ponge
5
 *
6
 *  File :               Info.java
7
 *  Description :        The information class for an installation.
8
 *  Author's email :     julien@izforge.com
9
 *  Author's Website :   http://www.izforge.com
10
 *
11
 *  This program is free software; you can redistribute it and/or
12
 *  modify it under the terms of the GNU General Public License
13
 *  as published by the Free Software Foundation; either version 2
14
 *  of the License, or any later version.
15
 *
16
 *  This program is distributed in the hope that it will be useful,
17
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19
 *  GNU General Public License for more details.
20
 *
21
 *  You should have received a copy of the GNU General Public License
22
 *  along with this program; if not, write to the Free Software
23
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
24
 */
25
package com.izforge.izpack;
26

    
27
import java.io.Serializable;
28
import java.util.ArrayList;
29

    
30
/**
31
 *  Contains some informations for an installer, as defined in the <info>
32
 *  section of the XML files.
33
 *
34
 * @author     Julien Ponge
35
 */
36
public class Info implements Serializable
37
{
38
  /**  The application name and version */
39
  private String appName = "", appVersion = "";
40

    
41
  /** The installation subpath */
42
  private String installationSubPath = null;
43
  /**  The application authors */
44
  private ArrayList authors = new ArrayList();
45

    
46
  /**  The application URL */
47
  private String appURL = null;
48

    
49
  /**  The required Java version (min) */
50
  private String javaVersion = "1.2";
51

    
52
  /**  The name of the installer file (name without jar suffix) */
53
  private String installerBase = null;
54

    
55
  /**  The application Web Directory URL */
56
  private String webDirURL = null;
57

    
58
  /**  The constructor, deliberatly void.  */
59
  public Info()
60
  {
61
  }
62

    
63
  /**
64
   *  Sets the application name.
65
   *
66
   * @param  appName  The new application name.
67
   */
68
  public void setAppName(String appName)
69
  {
70
    this.appName = appName;
71
  }
72

    
73
  /**
74
   *  Gets the application name.
75
   *
76
   * @return    The application name.
77
   */
78
  public String getAppName()
79
  {
80
    return appName;
81
  }
82

    
83
  /**
84
   *  Sets the version.
85
   *
86
   * @param  appVersion  The application version.
87
   */
88
  public void setAppVersion(String appVersion)
89
  {
90
    this.appVersion = appVersion;
91
  }
92

    
93
  /**
94
   *  Gets the version.
95
   *
96
   * @return    The application version.
97
   */
98
  public String getAppVersion()
99
  {
100
    return appVersion;
101
  }
102

    
103
  /**
104
   *  Adds an author to the authors list.
105
   *
106
   * @param  author  The author to add.
107
   */
108
  public void addAuthor(Author author)
109
  {
110
    authors.add(author);
111
  }
112

    
113
  /**
114
   *  Gets the authors list.
115
   *
116
   * @return    The authors list.
117
   */
118
  public ArrayList getAuthors()
119
  {
120
    return authors;
121
  }
122

    
123
  /**
124
   *  Sets the application URL.
125
   *
126
   * @param  appURL  The application URL.
127
   */
128
  public void setAppURL(String appURL)
129
  {
130
    this.appURL = appURL;
131
  }
132

    
133
  /**
134
   *  Gets the application URL.
135
   *
136
   * @return    The application URL.
137
   */
138
  public String getAppURL()
139
  {
140
    return appURL;
141
  }
142

    
143
  /**
144
   *  Sets the minimum Java version required.
145
   *
146
   * @param  javaVersion  The Java version.
147
   */
148
  public void setJavaVersion(String javaVersion)
149
  {
150
    this.javaVersion = javaVersion;
151
  }
152

    
153
  /**
154
   *  Gets the Java version required.
155
   *
156
   * @return    The Java version.
157
   */
158
  public String getJavaVersion()
159
  {
160
    return javaVersion;
161
  }
162

    
163
  /**
164
   *  Sets the installer name.
165
   *
166
   * @param  installerBase  The new installer name.
167
   */
168
  public void setInstallerBase(String installerBase)
169
  {
170
    this.installerBase = installerBase;
171
  }
172

    
173
  /**
174
   *  Gets the installer name.
175
   *
176
   * @return    The name of the installer file, without the jar suffix.
177
   */
178
  public String getInstallerBase()
179
  {
180
    return installerBase;
181
  }
182

    
183
  /**
184
   *  Sets the webDir URL.
185
   *
186
   * @param  url  The application URL.
187
   */
188
  public void setWebDirURL(String url)
189
  {
190
    this.webDirURL = url;
191
  }
192

    
193
  /**
194
   *  Gets the webDir URL if it has been specified
195
   *
196
   * @return The webDir URL from which the installer is retrieved, or
197
   *         <tt>null</tt> if non has been set.
198
   */
199
  public String getWebDirURL()
200
  {
201
    return webDirURL;
202
  }
203

    
204
  /**
205
   *  This class represents an author.
206
   *
207
   * @author     Julien Ponge
208
   */
209
  public static class Author implements Serializable
210
  {
211
    /**  The author name */
212
    private String name;
213

    
214
    /**  The author email */
215
    private String email;
216

    
217
    /**
218
     *  Gets the author name.
219
     *
220
     * @return    The author name.
221
     */
222
    public String getName()
223
    {
224
      return name;
225
    }
226

    
227
    /**
228
     *  Gets the author email.
229
     *
230
     * @return    The author email.
231
     */
232
    public String getEmail()
233
    {
234
      return email;
235
    }
236

    
237
    /**
238
     *  The constructor.
239
     *
240
     * @param  name   The author name.
241
     * @param  email  The author email.
242
     */
243
    public Author(String name, String email)
244
    {
245
      this.name = name;
246
      this.email = email;
247
    }
248

    
249
    /**
250
     *  Gets a String representation of the author.
251
     *
252
     * @return    The String representation of the author, in the form : name
253
     *      <email> .
254
     */
255
    public String toString()
256
    {
257
      return name + " <" + email + ">";
258
    }
259

    
260
  }
261
  /**
262
   * Gets the installation subpath.
263
   * @return the installation subpath
264
   */
265
  public String getInstallationSubPath()
266
  {
267
    return installationSubPath;
268
  }
269

    
270
  /**
271
   * Sets the installation subpath.
272
   * @param string subpath to be set
273
   */
274
  public void setInstallationSubPath(String string)
275
  {
276
    installationSubPath = string;
277
  }
278

    
279
}