Statistics
| Revision:

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

History | View | Annotate | Download (4.24 KB)

1
/*
2
 *  $Id: UninstallData.java,v 1.1 2006/06/14 07:29:07 cesar Exp $
3
 *  IzPack
4
 *  Copyright (C) 2001-2004 Julien Ponge
5
 *
6
 *  File :               UninstallData.java
7
 *  Description :        Uninstaller data.
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.installer;
26

    
27
import java.util.ArrayList;
28
import java.util.HashMap;
29
import java.util.List;
30
import java.util.Map;
31

    
32
import com.izforge.izpack.ExecutableFile;
33

    
34
/**
35
 *  Holds uninstallation data. Implemented as a singleton.
36
 *
37
 * @author     Julien Ponge
38
 * created    October 27, 2002
39
 */
40
public class UninstallData
41
{
42
  /**  The uninstall data object. */
43
  private static UninstallData instance = null;
44

    
45
  /**  The files list. */
46
  private List filesList;
47

    
48
  /**  The executables list. */
49
  private List executablesList;
50

    
51
  /**  The uninstaller jar filename. */
52
  private String uninstallerJarFilename;
53

    
54
  /**  The uninstaller path. */
55
  private String uninstallerPath;
56

    
57
  /**  Additional uninstall data like uninstaller listener list. */
58
  private Map additionalData;
59
  
60
  /**  The constructor.  */
61
  private UninstallData()
62
  {
63
    filesList = new ArrayList();
64
    executablesList = new ArrayList();
65
    additionalData  = new HashMap();
66
  }
67

    
68
  /**
69
   *  Returns the instance (it is a singleton).
70
   *
71
   * @return    The instance.
72
   */
73
  public synchronized static UninstallData getInstance()
74
  {
75
    if (instance == null)
76
      instance = new UninstallData();
77
    return instance;
78
  }
79

    
80
  /**
81
   *  Adds a file to the data.
82
   *
83
   * @param  path  The file to add.
84
   */
85
  public synchronized void addFile(String path)
86
  {
87
    filesList.add(path);
88
  }
89

    
90
  /**
91
   *  Returns the files list.
92
   *
93
   * @return    The files list.
94
   */
95
  public List getFilesList()
96
  {
97
    return filesList;
98
  }
99

    
100
  /**
101
   *  Adds an executable to the data.
102
   *
103
   * @param file The executable file.
104
   */
105
  public synchronized void addExecutable(ExecutableFile file)
106
  {
107
    executablesList.add(file);
108
  }
109

    
110
  /**
111
   *  Returns the executables list.
112
   *
113
   * @return    The executables list.
114
   */
115
  public List getExecutablesList()
116
  {
117
    return executablesList;
118
  }
119

    
120
  /**
121
   *  Returns the uninstaller jar filename.
122
   *
123
   * @return    The uninstaller jar filename.
124
   */
125
  public synchronized String getUninstallerJarFilename()
126
  {
127
    return uninstallerJarFilename;
128
  }
129

    
130
  /**
131
   *  Sets the uninstaller jar filename.
132
   *
133
   * @param  name  The uninstaller jar filename.
134
   */
135
  public synchronized void setUninstallerJarFilename(String name)
136
  {
137
    uninstallerJarFilename = name;
138
  }
139

    
140
  /**
141
   *  Returns the path to the uninstaller.
142
   *
143
   * @return    The uninstaller filename path.
144
   */
145
  public String getUninstallerPath()
146
  {
147
    return uninstallerPath;
148
  }
149

    
150
  /**
151
   *  Sets the uninstaller path.
152
   *
153
   * @param  path  The uninstaller path.
154
   */
155
  public void setUninstallerPath(String path)
156
  {
157
    uninstallerPath = path;
158
  }
159
  
160
  /**
161
   * Returns  additional uninstall data like uninstaller listener list.
162
   * @return additional uninstall data
163
   */
164
  public Map getAdditionalData()
165
  {
166
    return additionalData;
167
  }
168
 
169
  /**
170
   * Sets additional uninstall data like uninstaller listener list. 
171
   * @param name key for the additional uninstall data
172
   * @param value the additional uninstall data
173
   */
174
  public void addAdditionalData(String name, Object value)
175
  {
176
    additionalData.put(name, value);
177
  }
178
 
179
}