3 |
3 |
*
|
4 |
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
5 |
*
|
6 |
|
* This program is free software; you can redistribute it and/or
|
7 |
|
* modify it under the terms of the GNU General Public License
|
8 |
|
* as published by the Free Software Foundation; either version 3
|
9 |
|
* of the License, or (at your option) any later version.
|
|
6 |
* This program is free software; you can redistribute it and/or modify it under
|
|
7 |
* the terms of the GNU General Public License as published by the Free Software
|
|
8 |
* Foundation; either version 3 of the License, or (at your option) any later
|
|
9 |
* version.
|
10 |
10 |
*
|
11 |
|
* This program is distributed in the hope that it will be useful,
|
12 |
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
|
* GNU General Public License for more details.
|
|
11 |
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
13 |
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
14 |
* details.
|
15 |
15 |
*
|
16 |
|
* You should have received a copy of the GNU General Public License
|
17 |
|
* along with this program; if not, write to the Free Software
|
18 |
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
|
* MA 02110-1301, USA.
|
|
16 |
* You should have received a copy of the GNU General Public License along with
|
|
17 |
* this program; if not, write to the Free Software Foundation, Inc., 51
|
|
18 |
* Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
20 |
19 |
*
|
21 |
|
* For any additional information, do not hesitate to contact us
|
22 |
|
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
|
20 |
* For any additional information, do not hesitate to contact us at info AT
|
|
21 |
* gvsig.com, or visit our website www.gvsig.com.
|
23 |
22 |
*/
|
24 |
23 |
/*
|
25 |
24 |
* AUTHORS (In addition to CIT):
|
26 |
25 |
* 2010 {Prodevelop} {Task}
|
27 |
26 |
*/
|
28 |
|
|
29 |
27 |
package org.gvsig.installer.lib.impl.execution;
|
30 |
28 |
|
31 |
29 |
import java.io.BufferedInputStream;
|
... | ... | |
43 |
41 |
import java.util.HashSet;
|
44 |
42 |
import java.util.List;
|
45 |
43 |
import java.util.Map;
|
|
44 |
import java.util.Properties;
|
46 |
45 |
import java.util.Set;
|
|
46 |
import org.apache.commons.lang3.StringUtils;
|
47 |
47 |
|
48 |
48 |
import org.slf4j.Logger;
|
49 |
49 |
import org.slf4j.LoggerFactory;
|
... | ... | |
68 |
68 |
/**
|
69 |
69 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera Llodrá</a>
|
70 |
70 |
*/
|
71 |
|
|
72 |
71 |
public class DefaultInstallPackageService extends Thread implements
|
73 |
|
InstallPackageService {
|
|
72 |
InstallPackageService {
|
74 |
73 |
|
75 |
|
private static final Logger LOG = LoggerFactory
|
76 |
|
.getLogger(DefaultInstallPackageService.class);
|
77 |
|
|
78 |
|
private static final String PACKAGE_FILE_NAME = "packages.gvspki";
|
|
74 |
private static final Logger LOG = LoggerFactory
|
|
75 |
.getLogger(DefaultInstallPackageService.class);
|
79 |
76 |
|
80 |
|
private Map<PackageInfo, File> packageInfoFileMap = null;
|
81 |
|
private Map<PackageInfo, String> zipEntriesMap = null;
|
82 |
|
private List<PackageInfo> packageInfos = null;
|
83 |
|
private InstallerManager manager;
|
84 |
|
private InstallPackageProviderServices installerProviderServices = null;
|
|
77 |
private static final String PACKAGE_FILE_NAME = "packages.gvspki";
|
85 |
78 |
|
86 |
|
public DefaultInstallPackageService(DefaultInstallerManager manager) {
|
87 |
|
super();
|
88 |
|
this.manager = manager;
|
89 |
|
this.reset();
|
90 |
|
}
|
|
79 |
private Map<PackageInfo, File> packageInfoFileMap = null;
|
|
80 |
private Map<PackageInfo, String> zipEntriesMap = null;
|
|
81 |
private List<PackageInfo> packageInfos = null;
|
|
82 |
private InstallerManager manager;
|
|
83 |
private InstallPackageProviderServices installerProviderServices = null;
|
91 |
84 |
|
92 |
|
public void reset() {
|
93 |
|
packageInfoFileMap = new HashMap<PackageInfo, File>();
|
94 |
|
packageInfos = new ArrayList<PackageInfo>();
|
95 |
|
zipEntriesMap = new HashMap<PackageInfo, String>();
|
96 |
|
installerProviderServices = InstallerProviderLocator
|
97 |
|
.getProviderManager().createInstallerProviderServices();
|
98 |
|
}
|
|
85 |
public DefaultInstallPackageService(DefaultInstallerManager manager) {
|
|
86 |
super();
|
|
87 |
this.manager = manager;
|
|
88 |
this.reset();
|
|
89 |
}
|
99 |
90 |
|
100 |
|
public class InstallerApplicationDirectoryNotFoundException extends
|
101 |
|
InstallPackageServiceException {
|
|
91 |
public void reset() {
|
|
92 |
packageInfoFileMap = new HashMap<PackageInfo, File>();
|
|
93 |
packageInfos = new ArrayList<PackageInfo>();
|
|
94 |
zipEntriesMap = new HashMap<PackageInfo, String>();
|
|
95 |
installerProviderServices = InstallerProviderLocator
|
|
96 |
.getProviderManager().createInstallerProviderServices();
|
|
97 |
}
|
102 |
98 |
|
103 |
|
private static final long serialVersionUID = -1130408094135962456L;
|
|
99 |
public class InstallerApplicationDirectoryNotFoundException extends
|
|
100 |
InstallPackageServiceException {
|
104 |
101 |
|
105 |
|
private static final String message = "Aplication directory '%(directory)s' not found";
|
|
102 |
private static final long serialVersionUID = -1130408094135962456L;
|
106 |
103 |
|
107 |
|
private static final String KEY = "_aplication_directory_XdirectoryX_not_found";
|
|
104 |
private static final String message = "Aplication directory '%(directory)s' not found";
|
108 |
105 |
|
109 |
|
public InstallerApplicationDirectoryNotFoundException(File file) {
|
110 |
|
super(message, KEY, serialVersionUID);
|
111 |
|
setValue("directory", file.toString());
|
112 |
|
}
|
|
106 |
private static final String KEY = "_aplication_directory_XdirectoryX_not_found";
|
113 |
107 |
|
114 |
|
}
|
|
108 |
public InstallerApplicationDirectoryNotFoundException(File file) {
|
|
109 |
super(message, KEY, serialVersionUID);
|
|
110 |
setValue("directory", file.toString());
|
|
111 |
}
|
115 |
112 |
|
116 |
|
public class InstallerNoDirectoryException extends
|
117 |
|
InstallPackageServiceException {
|
|
113 |
}
|
118 |
114 |
|
119 |
|
private static final long serialVersionUID = -8685263049644983769L;
|
|
115 |
public class InstallerNoDirectoryException extends
|
|
116 |
InstallPackageServiceException {
|
120 |
117 |
|
121 |
|
private static final String message = "'%(directory)s' is not a directory";
|
|
118 |
private static final long serialVersionUID = -8685263049644983769L;
|
122 |
119 |
|
123 |
|
private static final String KEY = "_XdirectoryX_is_not_a_directory";
|
|
120 |
private static final String message = "'%(directory)s' is not a directory";
|
124 |
121 |
|
125 |
|
public InstallerNoDirectoryException(File file) {
|
126 |
|
super(message, KEY, serialVersionUID);
|
127 |
|
setValue("directory", file.toString());
|
128 |
|
}
|
|
122 |
private static final String KEY = "_XdirectoryX_is_not_a_directory";
|
129 |
123 |
|
130 |
|
}
|
|
124 |
public InstallerNoDirectoryException(File file) {
|
|
125 |
super(message, KEY, serialVersionUID);
|
|
126 |
setValue("directory", file.toString());
|
|
127 |
}
|
131 |
128 |
|
132 |
|
public class InstallerFileNotFoundException extends
|
133 |
|
InstallPackageServiceException {
|
|
129 |
}
|
134 |
130 |
|
135 |
|
private static final long serialVersionUID = 556517830330132149L;
|
|
131 |
public class InstallerFileNotFoundException extends
|
|
132 |
InstallPackageServiceException {
|
136 |
133 |
|
137 |
|
private static final String message = "File '%(file)s' not found";
|
|
134 |
private static final long serialVersionUID = 556517830330132149L;
|
138 |
135 |
|
139 |
|
private static final String KEY = "_file_XfileX_not_found";
|
|
136 |
private static final String message = "File '%(file)s' not found";
|
140 |
137 |
|
141 |
|
public InstallerFileNotFoundException(File file) {
|
142 |
|
super(message, KEY, serialVersionUID);
|
143 |
|
setValue("file", file.toString());
|
144 |
|
}
|
|
138 |
private static final String KEY = "_file_XfileX_not_found";
|
145 |
139 |
|
146 |
|
}
|
|
140 |
public InstallerFileNotFoundException(File file) {
|
|
141 |
super(message, KEY, serialVersionUID);
|
|
142 |
setValue("file", file.toString());
|
|
143 |
}
|
147 |
144 |
|
148 |
|
public class InstallerBundleNotFoundException extends
|
149 |
|
InstallPackageServiceException {
|
|
145 |
}
|
150 |
146 |
|
151 |
|
private static final long serialVersionUID = 5065410511582625301L;
|
|
147 |
public class InstallerBundleNotFoundException extends
|
|
148 |
InstallPackageServiceException {
|
152 |
149 |
|
153 |
|
private static final String message = "File '%(file)s' not found";
|
|
150 |
private static final long serialVersionUID = 5065410511582625301L;
|
154 |
151 |
|
155 |
|
private static final String KEY = "_file_XfileX_not_found";
|
|
152 |
private static final String message = "File '%(file)s' not found";
|
156 |
153 |
|
157 |
|
public InstallerBundleNotFoundException(File file,
|
158 |
|
FileNotFoundException e) {
|
159 |
|
super(message, e, KEY, serialVersionUID);
|
160 |
|
setValue("file", file.toString());
|
161 |
|
}
|
|
154 |
private static final String KEY = "_file_XfileX_not_found";
|
162 |
155 |
|
163 |
|
}
|
|
156 |
public InstallerBundleNotFoundException(File file,
|
|
157 |
FileNotFoundException e) {
|
|
158 |
super(message, e, KEY, serialVersionUID);
|
|
159 |
setValue("file", file.toString());
|
|
160 |
}
|
164 |
161 |
|
165 |
|
public class InstallerIOException extends InstallPackageServiceException {
|
|
162 |
}
|
166 |
163 |
|
167 |
|
private static final long serialVersionUID = 3153613550157712363L;
|
|
164 |
public class InstallerIOException extends InstallPackageServiceException {
|
168 |
165 |
|
169 |
|
private static final String message = "IO error installing the file '%(file)s'";
|
|
166 |
private static final long serialVersionUID = 3153613550157712363L;
|
170 |
167 |
|
171 |
|
private static final String KEY = "_IO_error installing_file_XfileX_";
|
|
168 |
private static final String message = "IO error installing the file '%(file)s'";
|
172 |
169 |
|
173 |
|
public InstallerIOException(File file, IOException e) {
|
174 |
|
super(message, e, KEY, serialVersionUID);
|
175 |
|
setValue("file", file.toString());
|
176 |
|
}
|
|
170 |
private static final String KEY = "_IO_error installing_file_XfileX_";
|
177 |
171 |
|
178 |
|
}
|
|
172 |
public InstallerIOException(File file, IOException e) {
|
|
173 |
super(message, e, KEY, serialVersionUID);
|
|
174 |
setValue("file", file.toString());
|
|
175 |
}
|
179 |
176 |
|
180 |
|
public class InstallerFileDownloadException extends
|
181 |
|
InstallPackageServiceException {
|
|
177 |
}
|
182 |
178 |
|
183 |
|
private static final long serialVersionUID = 8640183295766490512L;
|
|
179 |
public class InstallerFileDownloadException extends
|
|
180 |
InstallPackageServiceException {
|
184 |
181 |
|
185 |
|
private static final String message = "File '%(url)s' download error";
|
|
182 |
private static final long serialVersionUID = 8640183295766490512L;
|
186 |
183 |
|
187 |
|
private static final String KEY = "_File_XurlX_download_error";
|
|
184 |
private static final String message = "File '%(url)s' download error";
|
188 |
185 |
|
189 |
|
public InstallerFileDownloadException(URL url, IOException e) {
|
190 |
|
super(message, e, KEY, serialVersionUID);
|
191 |
|
setValue("url", url.toString());
|
192 |
|
}
|
|
186 |
private static final String KEY = "_File_XurlX_download_error";
|
193 |
187 |
|
194 |
|
}
|
|
188 |
public InstallerFileDownloadException(URL url, IOException e) {
|
|
189 |
super(message, e, KEY, serialVersionUID);
|
|
190 |
setValue("url", url.toString());
|
|
191 |
}
|
195 |
192 |
|
196 |
|
public class InstallerPackageNotFoundException extends
|
197 |
|
InstallPackageServiceException {
|
|
193 |
}
|
198 |
194 |
|
199 |
|
private static final long serialVersionUID = 1726608498886963868L;
|
|
195 |
public class InstallerPackageNotFoundException extends
|
|
196 |
InstallPackageServiceException {
|
200 |
197 |
|
201 |
|
private static final String message = "Package not found";
|
|
198 |
private static final long serialVersionUID = 1726608498886963868L;
|
202 |
199 |
|
203 |
|
private static final String KEY = "_package_not_found";
|
|
200 |
private static final String message = "Package not found";
|
204 |
201 |
|
205 |
|
public InstallerPackageNotFoundException() {
|
206 |
|
super(message, KEY, serialVersionUID);
|
207 |
|
}
|
|
202 |
private static final String KEY = "_package_not_found";
|
208 |
203 |
|
209 |
|
}
|
|
204 |
public InstallerPackageNotFoundException() {
|
|
205 |
super(message, KEY, serialVersionUID);
|
|
206 |
}
|
210 |
207 |
|
211 |
|
public class InstallerNoPackageException extends
|
212 |
|
InstallPackageServiceException {
|
|
208 |
}
|
213 |
209 |
|
214 |
|
private static final long serialVersionUID = -2292735515704746966L;
|
|
210 |
public class InstallerNoPackageException extends
|
|
211 |
InstallPackageServiceException {
|
215 |
212 |
|
216 |
|
private static final String message = "Package does not exist";
|
|
213 |
private static final long serialVersionUID = -2292735515704746966L;
|
217 |
214 |
|
218 |
|
private static final String KEY = "_package__does_not_exist";
|
|
215 |
private static final String message = "Package does not exist";
|
219 |
216 |
|
220 |
|
public InstallerNoPackageException() {
|
221 |
|
super(message, KEY, serialVersionUID);
|
222 |
|
}
|
|
217 |
private static final String KEY = "_package__does_not_exist";
|
223 |
218 |
|
224 |
|
}
|
|
219 |
public InstallerNoPackageException() {
|
|
220 |
super(message, KEY, serialVersionUID);
|
|
221 |
}
|
225 |
222 |
|
226 |
|
public class InstallerProviderCreationException extends
|
227 |
|
InstallPackageServiceException {
|
|
223 |
}
|
228 |
224 |
|
229 |
|
private static final long serialVersionUID = -7985786807492393584L;
|
|
225 |
public class InstallerProviderCreationException extends
|
|
226 |
InstallPackageServiceException {
|
230 |
227 |
|
231 |
|
private static final String message = "Error creating the provider";
|
|
228 |
private static final long serialVersionUID = -7985786807492393584L;
|
232 |
229 |
|
233 |
|
private static final String KEY = "_Error_creating_the_provider";
|
|
230 |
private static final String message = "Error creating the provider";
|
234 |
231 |
|
235 |
|
public InstallerProviderCreationException(ServiceException e) {
|
236 |
|
super(message, e, KEY, serialVersionUID);
|
237 |
|
}
|
|
232 |
private static final String KEY = "_Error_creating_the_provider";
|
238 |
233 |
|
239 |
|
}
|
|
234 |
public InstallerProviderCreationException(ServiceException e) {
|
|
235 |
super(message, e, KEY, serialVersionUID);
|
|
236 |
}
|
240 |
237 |
|
241 |
|
public void installPackage(File applicationDirectory,
|
242 |
|
PackageInfo packageInfo) throws InstallPackageServiceException {
|
243 |
|
if (!applicationDirectory.exists()) {
|
244 |
|
LOG.warn("Can install package '"+packageInfo.getCode()+"', application folder '"+applicationDirectory.toString()+"' does not exits.");
|
245 |
|
throw new InstallerApplicationDirectoryNotFoundException(
|
246 |
|
applicationDirectory);
|
247 |
|
}
|
248 |
|
if (!packageInfoFileMap.containsKey(packageInfo)) {
|
249 |
|
LOG.warn("Can install package '"+packageInfo.getCode()+"', package not found.");
|
250 |
|
throw new InstallerPackageNotFoundException();
|
251 |
|
}
|
|
238 |
}
|
252 |
239 |
|
253 |
|
InstallPackageProvider installerExecutionProvider = createProvider(packageInfo);
|
|
240 |
public void installPackage(File applicationDirectory,
|
|
241 |
PackageInfo packageInfo) throws InstallPackageServiceException {
|
|
242 |
if (!applicationDirectory.exists()) {
|
|
243 |
LOG.warn("Can install package '" + packageInfo.getCode() + "', application folder '" + applicationDirectory.toString() + "' does not exits.");
|
|
244 |
throw new InstallerApplicationDirectoryNotFoundException(
|
|
245 |
applicationDirectory);
|
|
246 |
}
|
|
247 |
if (!packageInfoFileMap.containsKey(packageInfo)) {
|
|
248 |
LOG.warn("Can install package '" + packageInfo.getCode() + "', package not found.");
|
|
249 |
throw new InstallerPackageNotFoundException();
|
|
250 |
}
|
254 |
251 |
|
255 |
|
// Get the package or package set file
|
256 |
|
File file = packageInfoFileMap.get(packageInfo);
|
257 |
|
if (file == null) {
|
258 |
|
if (packageInfo.getDownloadURL() == null) {
|
259 |
|
throw new InstallerPackageNotFoundException();
|
260 |
|
}
|
261 |
|
this.downloadPackage(packageInfo);
|
262 |
|
file = packageInfoFileMap.get(packageInfo);
|
263 |
|
}
|
|
252 |
InstallPackageProvider installerExecutionProvider = createProvider(packageInfo);
|
264 |
253 |
|
265 |
|
// Open and install the package or package set file
|
266 |
|
try {
|
|
254 |
// Get the package or package set file
|
|
255 |
File file = packageInfoFileMap.get(packageInfo);
|
|
256 |
if (file == null) {
|
|
257 |
if (packageInfo.getDownloadURL() == null) {
|
|
258 |
throw new InstallerPackageNotFoundException();
|
|
259 |
}
|
|
260 |
this.downloadPackage(packageInfo);
|
|
261 |
file = packageInfoFileMap.get(packageInfo);
|
|
262 |
}
|
267 |
263 |
|
268 |
|
InputStream packageStream;
|
269 |
|
InputStream fis = new FileInputStream(file);
|
270 |
|
InputStream bis = new BufferedInputStream(fis);
|
271 |
|
if (isPackage(file)) {
|
272 |
|
packageStream = bis;
|
273 |
|
} else {
|
274 |
|
if (!isPackageSet(file)) {
|
275 |
|
LOG.info("Trying to install a package file ({0}) "
|
276 |
|
+ "without a known file extension. Will try "
|
277 |
|
+ "to install it as a package set", file);
|
278 |
|
}
|
279 |
|
packageStream = installerProviderServices.searchPackage(bis,
|
280 |
|
zipEntriesMap.get(packageInfo));
|
281 |
|
}
|
|
264 |
// Open and install the package or package set file
|
|
265 |
try {
|
282 |
266 |
|
283 |
|
try {
|
284 |
|
installerExecutionProvider.install(applicationDirectory,
|
285 |
|
packageStream, packageInfo);
|
286 |
|
} catch (InstallPackageServiceException e) {
|
|
267 |
InputStream packageStream;
|
|
268 |
InputStream fis = new FileInputStream(file);
|
|
269 |
InputStream bis = new BufferedInputStream(fis);
|
|
270 |
if (isPackage(file)) {
|
|
271 |
packageStream = bis;
|
|
272 |
} else {
|
|
273 |
if (!isPackageSet(file)) {
|
|
274 |
LOG.info("Trying to install a package file ({0}) "
|
|
275 |
+ "without a known file extension. Will try "
|
|
276 |
+ "to install it as a package set", file);
|
|
277 |
}
|
|
278 |
packageStream = installerProviderServices.searchPackage(bis,
|
|
279 |
zipEntriesMap.get(packageInfo));
|
|
280 |
}
|
287 |
281 |
|
288 |
|
packageStream.close();
|
289 |
|
if (bis != packageStream) {
|
290 |
|
bis.close();
|
291 |
|
}
|
292 |
|
fis.close();
|
|
282 |
try {
|
|
283 |
installerExecutionProvider.install(applicationDirectory,
|
|
284 |
packageStream, packageInfo);
|
|
285 |
} catch (InstallPackageServiceException e) {
|
293 |
286 |
|
294 |
|
// if fails the installation, zip files need to be reopen
|
295 |
|
// the package will be installed into the update folder for
|
296 |
|
// installation after a gvSIG restart
|
|
287 |
packageStream.close();
|
|
288 |
if (bis != packageStream) {
|
|
289 |
bis.close();
|
|
290 |
}
|
|
291 |
fis.close();
|
297 |
292 |
|
298 |
|
fis = new FileInputStream(file);
|
299 |
|
bis = new BufferedInputStream(fis);
|
300 |
|
if (isPackage(file)) {
|
301 |
|
packageStream = bis;
|
302 |
|
} else {
|
303 |
|
if (!isPackageSet(file)) {
|
304 |
|
LOG.info("Trying to install a package file ({0}) "
|
305 |
|
+ "without a known file extension. Will try "
|
306 |
|
+ "to install it as a package set", file);
|
307 |
|
}
|
308 |
|
packageStream = installerProviderServices.searchPackage(
|
309 |
|
bis, zipEntriesMap.get(packageInfo));
|
310 |
|
}
|
311 |
|
installerExecutionProvider.installLater(applicationDirectory,
|
312 |
|
packageStream, packageInfo);
|
313 |
|
}
|
|
293 |
// if fails the installation, zip files need to be reopen
|
|
294 |
// the package will be installed into the update folder for
|
|
295 |
// installation after a gvSIG restart
|
|
296 |
fis = new FileInputStream(file);
|
|
297 |
bis = new BufferedInputStream(fis);
|
|
298 |
if (isPackage(file)) {
|
|
299 |
packageStream = bis;
|
|
300 |
} else {
|
|
301 |
if (!isPackageSet(file)) {
|
|
302 |
LOG.info("Trying to install a package file ({0}) "
|
|
303 |
+ "without a known file extension. Will try "
|
|
304 |
+ "to install it as a package set", file);
|
|
305 |
}
|
|
306 |
packageStream = installerProviderServices.searchPackage(
|
|
307 |
bis, zipEntriesMap.get(packageInfo));
|
|
308 |
}
|
|
309 |
installerExecutionProvider.installLater(applicationDirectory,
|
|
310 |
packageStream, packageInfo);
|
|
311 |
}
|
314 |
312 |
|
315 |
|
packageStream.close();
|
316 |
|
if (bis != packageStream) {
|
317 |
|
bis.close();
|
318 |
|
}
|
319 |
|
fis.close();
|
|
313 |
packageStream.close();
|
|
314 |
if (bis != packageStream) {
|
|
315 |
bis.close();
|
|
316 |
}
|
|
317 |
fis.close();
|
320 |
318 |
|
321 |
|
} catch (FileNotFoundException e) {
|
322 |
|
throw new InstallerFileNotFoundException(file);
|
323 |
|
} catch (IOException e) {
|
324 |
|
throw new InstallerIOException(file, e);
|
325 |
|
}
|
|
319 |
} catch (FileNotFoundException e) {
|
|
320 |
throw new InstallerFileNotFoundException(file);
|
|
321 |
} catch (IOException e) {
|
|
322 |
throw new InstallerIOException(file, e);
|
|
323 |
}
|
326 |
324 |
|
327 |
|
}
|
|
325 |
}
|
328 |
326 |
|
329 |
|
public void installPackage(File applicationDirectory, String packageCode)
|
330 |
|
throws InstallPackageServiceException {
|
331 |
|
PackageInfo packageInfo = getPackageInfo(packageCode);
|
332 |
|
if (packageInfo == null) {
|
333 |
|
throw new InstallerNoPackageException();
|
334 |
|
}
|
335 |
|
installPackage(applicationDirectory, packageInfo);
|
336 |
|
}
|
|
327 |
public void installPackage(File applicationDirectory, String packageCode)
|
|
328 |
throws InstallPackageServiceException {
|
|
329 |
PackageInfo packageInfo = getPackageInfo(packageCode);
|
|
330 |
if (packageInfo == null) {
|
|
331 |
throw new InstallerNoPackageException();
|
|
332 |
}
|
|
333 |
installPackage(applicationDirectory, packageInfo);
|
|
334 |
}
|
337 |
335 |
|
338 |
|
private InstallPackageProvider createProvider(PackageInfo packageInfo)
|
339 |
|
throws InstallPackageServiceException {
|
340 |
|
InstallerProviderManager installerProviderManager = (InstallerProviderManager) ((DefaultInstallerManager) manager)
|
341 |
|
.getProviderManager();
|
|
336 |
private InstallPackageProvider createProvider(PackageInfo packageInfo)
|
|
337 |
throws InstallPackageServiceException {
|
|
338 |
InstallerProviderManager installerProviderManager = (InstallerProviderManager) ((DefaultInstallerManager) manager)
|
|
339 |
.getProviderManager();
|
342 |
340 |
|
343 |
|
try {
|
344 |
|
return installerProviderManager.createExecutionProvider(packageInfo
|
345 |
|
.getType());
|
346 |
|
} catch (ServiceException e) {
|
347 |
|
throw new InstallerProviderCreationException(e);
|
348 |
|
}
|
349 |
|
}
|
|
341 |
try {
|
|
342 |
return installerProviderManager.createExecutionProvider(packageInfo
|
|
343 |
.getType());
|
|
344 |
} catch (ServiceException e) {
|
|
345 |
throw new InstallerProviderCreationException(e);
|
|
346 |
}
|
|
347 |
}
|
350 |
348 |
|
351 |
|
public PackageInfo getPackageInfo(int index) {
|
352 |
|
if (index >= packageInfos.size()) {
|
353 |
|
return null;
|
354 |
|
}
|
355 |
|
return packageInfos.get(index);
|
356 |
|
}
|
|
349 |
public PackageInfo getPackageInfo(int index) {
|
|
350 |
if (index >= packageInfos.size()) {
|
|
351 |
return null;
|
|
352 |
}
|
|
353 |
return packageInfos.get(index);
|
|
354 |
}
|
357 |
355 |
|
358 |
|
public PackageInfo getPackageInfo(String packageCode) {
|
359 |
|
for (int i = 0; i < getPackageCount(); i++) {
|
360 |
|
if (packageInfos.get(i).getCode().equals(packageCode)) {
|
361 |
|
return packageInfos.get(i);
|
362 |
|
}
|
363 |
|
}
|
364 |
|
return null;
|
365 |
|
}
|
|
356 |
public PackageInfo getPackageInfo(String packageCode) {
|
|
357 |
for (int i = 0; i < getPackageCount(); i++) {
|
|
358 |
if (packageInfos.get(i).getCode().equals(packageCode)) {
|
|
359 |
return packageInfos.get(i);
|
|
360 |
}
|
|
361 |
}
|
|
362 |
return null;
|
|
363 |
}
|
366 |
364 |
|
367 |
|
public void addBundle(File bundle) throws InstallPackageServiceException {
|
|
365 |
@Override
|
|
366 |
public void addBundle(File bundle, SimpleTaskStatus taskStatus) throws InstallPackageServiceException {
|
368 |
367 |
|
369 |
|
if (!bundle.exists()) {
|
370 |
|
throw new InstallPackageServiceException();
|
371 |
|
}
|
|
368 |
if (!bundle.exists()) {
|
|
369 |
throw new InstallPackageServiceException();
|
|
370 |
}
|
372 |
371 |
|
373 |
|
int packageInfoCount = packageInfos.size();
|
|
372 |
int packageInfoCount = packageInfos.size();
|
374 |
373 |
|
375 |
|
FileInputStream fis;
|
376 |
|
try {
|
377 |
|
fis = new FileInputStream(bundle);
|
378 |
|
} catch (FileNotFoundException e) {
|
379 |
|
throw new InstallerBundleNotFoundException(bundle, e);
|
380 |
|
}
|
381 |
|
BufferedInputStream bis = new BufferedInputStream(fis);
|
382 |
|
if (isPackage(bundle)) {
|
383 |
|
installerProviderServices.readPackageInfo(bis, packageInfos,
|
384 |
|
zipEntriesMap, bundle.getName());
|
385 |
|
} else {
|
386 |
|
if (!isPackageSet(bundle)) {
|
387 |
|
LOG
|
388 |
|
.info(
|
389 |
|
"Trying to add a package file ({0}) without a known "
|
390 |
|
+ "file extension. Will try to add it as a package set",
|
391 |
|
bundle);
|
392 |
|
}
|
393 |
|
installerProviderServices.readPackageSetInfo(fis, packageInfos,
|
394 |
|
zipEntriesMap);
|
395 |
|
}
|
396 |
|
try {
|
397 |
|
bis.close();
|
398 |
|
fis.close();
|
399 |
|
} catch (IOException e) {
|
400 |
|
LOG.info("Error closing the input streams of the package file: "
|
401 |
|
+ bundle, e);
|
402 |
|
}
|
|
374 |
FileInputStream fis;
|
|
375 |
try {
|
|
376 |
fis = new FileInputStream(bundle);
|
|
377 |
} catch (FileNotFoundException e) {
|
|
378 |
throw new InstallerBundleNotFoundException(bundle, e);
|
|
379 |
}
|
|
380 |
BufferedInputStream bis = new BufferedInputStream(fis);
|
|
381 |
if (isPackage(bundle)) {
|
|
382 |
installerProviderServices.readPackageInfo(bis, packageInfos,
|
|
383 |
zipEntriesMap, bundle.getName(), taskStatus);
|
|
384 |
} else {
|
|
385 |
if (!isPackageSet(bundle)) {
|
|
386 |
LOG
|
|
387 |
.info(
|
|
388 |
"Trying to add a package file ({0}) without a known "
|
|
389 |
+ "file extension. Will try to add it as a package set",
|
|
390 |
bundle);
|
|
391 |
}
|
|
392 |
installerProviderServices.readPackageSetInfo(fis, packageInfos,
|
|
393 |
zipEntriesMap, taskStatus);
|
|
394 |
}
|
|
395 |
try {
|
|
396 |
bis.close();
|
|
397 |
fis.close();
|
|
398 |
} catch (IOException e) {
|
|
399 |
LOG.info("Error closing the input streams of the package file: "
|
|
400 |
+ bundle, e);
|
|
401 |
}
|
403 |
402 |
|
404 |
|
for (int i = packageInfoCount; i < packageInfos.size(); i++) {
|
405 |
|
packageInfoFileMap.put(packageInfos.get(i), bundle);
|
406 |
|
}
|
407 |
|
}
|
|
403 |
for (int i = packageInfoCount; i < packageInfos.size(); i++) {
|
|
404 |
packageInfoFileMap.put(packageInfos.get(i), bundle);
|
|
405 |
}
|
|
406 |
}
|
408 |
407 |
|
409 |
|
private boolean isPackageSet(File file) {
|
410 |
|
return file.getName().endsWith(
|
411 |
|
manager.getDefaultPackageSetFileExtension());
|
412 |
|
}
|
|
408 |
private boolean isPackageSet(File file) {
|
|
409 |
return file.getName().endsWith(
|
|
410 |
manager.getDefaultPackageSetFileExtension());
|
|
411 |
}
|
413 |
412 |
|
414 |
|
private boolean isPackage(File file) {
|
415 |
|
return file.getName()
|
416 |
|
.endsWith(manager.getDefaultPackageFileExtension());
|
417 |
|
}
|
|
413 |
private boolean isPackage(File file) {
|
|
414 |
return file.getName()
|
|
415 |
.endsWith(manager.getDefaultPackageFileExtension());
|
|
416 |
}
|
418 |
417 |
|
419 |
|
public void addBundle(URL bundleURL) throws InstallPackageServiceException {
|
420 |
|
File bundle;
|
421 |
|
String urlString = bundleURL.toString();
|
422 |
|
if (urlString.endsWith(InstallerManager.PACKAGE_EXTENSION) || urlString.endsWith(InstallerManager.PACKAGE_INDEX_EXTENSION)) {
|
|
418 |
@Override
|
|
419 |
public void addBundle(URL bundleURL, SimpleTaskStatus taskStatus) throws InstallPackageServiceException {
|
|
420 |
File bundle;
|
|
421 |
String urlString = bundleURL.toString();
|
|
422 |
if (urlString.endsWith(InstallerManager.PACKAGE_EXTENSION) || urlString.endsWith(InstallerManager.PACKAGE_INDEX_EXTENSION)) {
|
423 |
423 |
manager.setDownloadBaseURL(bundleURL);
|
424 |
|
bundle = downloadFile(bundleURL, PACKAGE_FILE_NAME);
|
425 |
|
addBundle(bundle);
|
426 |
|
} else {
|
427 |
|
if (!urlString.endsWith("/")) {
|
428 |
|
urlString += "/";
|
429 |
|
}
|
430 |
|
|
431 |
|
Version version = manager.getVersionEx();
|
432 |
|
urlString += ("dists/"
|
433 |
|
+ version.getMayor() + "." + version.getMinor() + "."
|
434 |
|
+ version.getRevision() + "/" + PACKAGE_FILE_NAME);
|
435 |
|
|
|
424 |
bundle = downloadFile(bundleURL, PACKAGE_FILE_NAME);
|
|
425 |
addBundle(bundle,taskStatus);
|
|
426 |
} else {
|
|
427 |
if (!urlString.endsWith("/")) {
|
|
428 |
urlString += "/";
|
|
429 |
}
|
436 |
430 |
|
437 |
|
URL completeURL;
|
438 |
|
try {
|
439 |
|
completeURL = new URL(urlString);
|
440 |
|
} catch (MalformedURLException e) {
|
441 |
|
// TODO Auto-generated catch block
|
442 |
|
e.printStackTrace();
|
443 |
|
return;
|
444 |
|
}
|
|
431 |
Version version = manager.getVersionEx();
|
|
432 |
urlString += ("dists/"
|
|
433 |
+ version.getMayor() + "." + version.getMinor() + "."
|
|
434 |
+ version.getRevision() + "/" + PACKAGE_FILE_NAME);
|
445 |
435 |
|
|
436 |
URL completeURL;
|
|
437 |
try {
|
|
438 |
completeURL = new URL(urlString);
|
|
439 |
} catch (MalformedURLException e) {
|
|
440 |
// TODO Auto-generated catch block
|
|
441 |
e.printStackTrace();
|
|
442 |
return;
|
|
443 |
}
|
|
444 |
|
446 |
445 |
manager.setDownloadBaseURL(completeURL);
|
447 |
|
bundle = downloadFile(completeURL, PACKAGE_FILE_NAME);
|
448 |
|
addBundle(bundle);
|
449 |
|
}
|
|
446 |
bundle = downloadFile(completeURL, PACKAGE_FILE_NAME);
|
|
447 |
addBundle(bundle,taskStatus);
|
|
448 |
}
|
450 |
449 |
|
451 |
|
}
|
|
450 |
}
|
452 |
451 |
|
453 |
|
private File downloadFile(URL bundleURL, String defaultFileName)
|
454 |
|
throws InstallPackageServiceException {
|
455 |
|
try {
|
456 |
|
Download download = new Download();
|
457 |
|
return download.downloadFile(bundleURL, defaultFileName);
|
458 |
|
} catch (IOException e) {
|
459 |
|
throw new InstallerFileDownloadException(bundleURL, e);
|
460 |
|
}
|
461 |
|
}
|
|
452 |
private File downloadFile(URL bundleURL, String defaultFileName)
|
|
453 |
throws InstallPackageServiceException {
|
|
454 |
try {
|
|
455 |
Download download = new Download();
|
|
456 |
return download.downloadFile(bundleURL, defaultFileName);
|
|
457 |
} catch (IOException e) {
|
|
458 |
throw new InstallerFileDownloadException(bundleURL, e);
|
|
459 |
}
|
|
460 |
}
|
462 |
461 |
|
463 |
|
public void addBundlesFromDirectory(File directory)
|
464 |
|
throws InstallPackageServiceException {
|
465 |
|
if (!directory.isDirectory()) {
|
466 |
|
throw new InstallerNoDirectoryException(directory);
|
467 |
|
}
|
468 |
|
List<File> files = new ArrayList<File>();
|
|
462 |
@Override
|
|
463 |
public void addBundlesFromDirectory(File directory, SimpleTaskStatus taskStatus)
|
|
464 |
throws InstallPackageServiceException {
|
|
465 |
if (!directory.isDirectory()) {
|
|
466 |
throw new InstallerNoDirectoryException(directory);
|
|
467 |
}
|
|
468 |
List<File> files = new ArrayList<File>();
|
469 |
469 |
|
470 |
|
listRecursively(directory, new FileFilter() {
|
|
470 |
listRecursively(directory, new FileFilter() {
|
471 |
471 |
|
472 |
|
private String packageExt = manager
|
473 |
|
.getDefaultPackageFileExtension();
|
474 |
|
private String packageSetExt = manager
|
475 |
|
.getDefaultPackageSetFileExtension();
|
|
472 |
private String packageExt = manager
|
|
473 |
.getDefaultPackageFileExtension();
|
|
474 |
private String packageSetExt = manager
|
|
475 |
.getDefaultPackageSetFileExtension();
|
476 |
476 |
|
477 |
|
public boolean accept(File file) {
|
478 |
|
String name = file.getName().toLowerCase();
|
479 |
|
return file.isDirectory() || name.endsWith(packageExt)
|
480 |
|
|| name.endsWith(packageSetExt);
|
481 |
|
}
|
482 |
|
}, files);
|
483 |
|
for (int i = 0; i < files.size(); i++) {
|
484 |
|
if (files.get(i).isFile()) {
|
485 |
|
addBundle(files.get(i));
|
486 |
|
}
|
487 |
|
}
|
488 |
|
}
|
|
477 |
public boolean accept(File file) {
|
|
478 |
String name = file.getName().toLowerCase();
|
|
479 |
return file.isDirectory() || name.endsWith(packageExt)
|
|
480 |
|| name.endsWith(packageSetExt);
|
|
481 |
}
|
|
482 |
}, files);
|
|
483 |
for (int i = 0; i < files.size(); i++) {
|
|
484 |
if (files.get(i).isFile()) {
|
|
485 |
addBundle(files.get(i),taskStatus);
|
|
486 |
}
|
|
487 |
}
|
|
488 |
}
|
489 |
489 |
|
490 |
|
private void listRecursively(File fileOrDir, FileFilter filter,
|
491 |
|
List<File> files) {
|
492 |
|
files.add(fileOrDir);
|
|
490 |
private void listRecursively(File fileOrDir, FileFilter filter,
|
|
491 |
List<File> files) {
|
|
492 |
files.add(fileOrDir);
|
493 |
493 |
|
494 |
|
if (fileOrDir.isDirectory()) {
|
|
494 |
if (fileOrDir.isDirectory()) {
|
495 |
495 |
|
496 |
|
File[] dirContents = fileOrDir.listFiles(filter);
|
|
496 |
File[] dirContents = fileOrDir.listFiles(filter);
|
497 |
497 |
|
498 |
|
for (File f : dirContents) {
|
499 |
|
listRecursively(f, filter, files); // Recursively list.
|
500 |
|
}
|
501 |
|
} else {
|
502 |
|
files.add(fileOrDir);
|
503 |
|
}
|
504 |
|
}
|
|
498 |
for (File f : dirContents) {
|
|
499 |
listRecursively(f, filter, files); // Recursively list.
|
|
500 |
}
|
|
501 |
} else {
|
|
502 |
files.add(fileOrDir);
|
|
503 |
}
|
|
504 |
}
|
505 |
505 |
|
506 |
|
public int getPackageCount() {
|
507 |
|
if (packageInfos == null) {
|
508 |
|
return 0;
|
509 |
|
}
|
510 |
|
return packageInfos.size();
|
511 |
|
}
|
|
506 |
public int getPackageCount() {
|
|
507 |
if (packageInfos == null) {
|
|
508 |
return 0;
|
|
509 |
}
|
|
510 |
return packageInfos.size();
|
|
511 |
}
|
512 |
512 |
|
513 |
|
public Manager getManager() {
|
514 |
|
return this.manager;
|
515 |
|
}
|
|
513 |
public Manager getManager() {
|
|
514 |
return this.manager;
|
|
515 |
}
|
516 |
516 |
|
517 |
|
public void downloadPackage(PackageInfo packageInfo)
|
518 |
|
throws InstallPackageServiceException {
|
519 |
|
this.downloadPackage(packageInfo, null);
|
520 |
|
}
|
|
517 |
public void downloadPackage(PackageInfo packageInfo)
|
|
518 |
throws InstallPackageServiceException {
|
|
519 |
this.downloadPackage(packageInfo, null);
|
|
520 |
}
|
521 |
521 |
|
522 |
|
public void downloadPackage(PackageInfo packageInfo,
|
523 |
|
SimpleTaskStatus taskStatus) throws InstallPackageServiceException {
|
524 |
|
|
525 |
|
File file = null;
|
526 |
|
|
527 |
|
try {
|
528 |
|
file = packageInfo.downloadFile(taskStatus);
|
529 |
|
} catch (BaseException e) {
|
530 |
|
throw new InstallPackageServiceException(e);
|
|
522 |
public void downloadPackage(PackageInfo packageInfo,
|
|
523 |
SimpleTaskStatus taskStatus) throws InstallPackageServiceException {
|
|
524 |
|
|
525 |
File file = packageInfoFileMap.get(packageInfo);
|
|
526 |
if (file == null) {
|
|
527 |
try {
|
|
528 |
file = packageInfo.downloadFile(taskStatus);
|
|
529 |
} catch (BaseException e) {
|
|
530 |
throw new InstallPackageServiceException(e);
|
|
531 |
}
|
|
532 |
this.packageInfoFileMap.put(packageInfo, file);
|
531 |
533 |
}
|
532 |
|
this.packageInfoFileMap.put(packageInfo, file);
|
533 |
|
}
|
|
534 |
}
|
534 |
535 |
|
535 |
|
public List<String> getDefaultSelectedPackagesIDs() {
|
536 |
|
return installerProviderServices.getDefaultSelectedPackagesIDs();
|
537 |
|
}
|
|
536 |
public List<String> getDefaultSelectedPackagesIDs() {
|
|
537 |
return installerProviderServices.getDefaultSelectedPackagesIDs();
|
|
538 |
}
|
538 |
539 |
|
539 |
|
public List<String> getCategories() {
|
540 |
|
Set<String> categories = new HashSet<String>();
|
|
540 |
@Override
|
|
541 |
public Properties getProperties() {
|
|
542 |
return installerProviderServices.getProperties();
|
|
543 |
}
|
541 |
544 |
|
542 |
|
for (int i = 0; i < packageInfos.size(); i++) {
|
543 |
|
PackageInfo pkginfo = packageInfos.get(i);
|
544 |
|
List<String> pkgcategories = pkginfo.getCategories();
|
545 |
|
categories.addAll(pkgcategories);
|
546 |
|
}
|
547 |
|
try {
|
548 |
|
PackageInfo[] pkgs = manager.getInstalledPackages();
|
549 |
|
for (int i = 0; i < pkgs.length; i++) {
|
550 |
|
PackageInfo pkginfo = pkgs[i];
|
551 |
|
List<String> pkgcategories = pkginfo.getCategories();
|
552 |
|
categories.addAll(pkgcategories);
|
553 |
|
}
|
554 |
|
|
555 |
|
} catch (MakePluginPackageServiceException e) {
|
556 |
|
// Ignore exceptions
|
557 |
|
}
|
558 |
|
ArrayList<String> l = new ArrayList<String>(categories);
|
559 |
|
Collections.sort(l);
|
560 |
|
return l;
|
561 |
|
}
|
|
545 |
public List<String> getCategories() {
|
|
546 |
Set<String> categories = new HashSet<String>();
|
562 |
547 |
|
563 |
|
public List<String> getTypes() {
|
564 |
|
Set<String> types = new HashSet<String>();
|
|
548 |
for (int i = 0; i < packageInfos.size(); i++) {
|
|
549 |
PackageInfo pkginfo = packageInfos.get(i);
|
|
550 |
List<String> pkgcategories = pkginfo.getCategories();
|
|
551 |
categories.addAll(pkgcategories);
|
|
552 |
}
|
|
553 |
try {
|
|
554 |
PackageInfo[] pkgs = manager.getInstalledPackages();
|
|
555 |
for (int i = 0; i < pkgs.length; i++) {
|
|
556 |
PackageInfo pkginfo = pkgs[i];
|
|
557 |
List<String> pkgcategories = pkginfo.getCategories();
|
|
558 |
categories.addAll(pkgcategories);
|
|
559 |
}
|
565 |
560 |
|
566 |
|
for (int i = 0; i < packageInfos.size(); i++) {
|
567 |
|
PackageInfo pkginfo = packageInfos.get(i);
|
568 |
|
types.add(pkginfo.getType());
|
569 |
|
}
|
570 |
|
try {
|
571 |
|
PackageInfo[] pkgs = manager.getInstalledPackages();
|
572 |
|
for (int i = 0; i < pkgs.length; i++) {
|
573 |
|
PackageInfo pkginfo = pkgs[i];
|
574 |
|
types.add(pkginfo.getType());
|
575 |
|
}
|
576 |
|
|
577 |
|
} catch (MakePluginPackageServiceException e) {
|
578 |
|
// Ignore exceptions
|
579 |
|
}
|
580 |
|
ArrayList<String> l = new ArrayList<String>(types);
|
581 |
|
Collections.sort(l);
|
582 |
|
return l;
|
583 |
|
}
|
|
561 |
} catch (MakePluginPackageServiceException e) {
|
|
562 |
// Ignore exceptions
|
|
563 |
}
|
|
564 |
ArrayList<String> l = new ArrayList<String>(categories);
|
|
565 |
Collections.sort(l);
|
|
566 |
return l;
|
|
567 |
}
|
584 |
568 |
|
|
569 |
public List<String> getTypes() {
|
|
570 |
Set<String> types = new HashSet<String>();
|
|
571 |
|
|
572 |
for (int i = 0; i < packageInfos.size(); i++) {
|
|
573 |
PackageInfo pkginfo = packageInfos.get(i);
|
|
574 |
types.add(pkginfo.getType());
|
|
575 |
}
|
|
576 |
try {
|
|
577 |
PackageInfo[] pkgs = manager.getInstalledPackages();
|
|
578 |
for (int i = 0; i < pkgs.length; i++) {
|
|
579 |
PackageInfo pkginfo = pkgs[i];
|
|
580 |
types.add(pkginfo.getType());
|
|
581 |
}
|
|
582 |
|
|
583 |
} catch (MakePluginPackageServiceException e) {
|
|
584 |
// Ignore exceptions
|
|
585 |
}
|
|
586 |
List<String> l = new ArrayList<>(types);
|
|
587 |
Collections.sort(l);
|
|
588 |
return l;
|
|
589 |
}
|
|
590 |
|
|
591 |
@Override
|
|
592 |
public boolean needInstallPackageProviders() {
|
|
593 |
boolean need = false;
|
|
594 |
String ss = this.getProperties().getProperty("installers");
|
|
595 |
if (ss != null) {
|
|
596 |
String[] installerNames = StringUtils.split(ss);
|
|
597 |
for (String installerName : installerNames) {
|
|
598 |
InstallerProviderInstallers installer = new InstallerProviderInstallers(this, installerName);
|
|
599 |
if( !installer.isAlreadyRegistered() ) {
|
|
600 |
need = true;
|
|
601 |
break;
|
|
602 |
}
|
|
603 |
}
|
|
604 |
}
|
|
605 |
return need;
|
|
606 |
}
|
|
607 |
|
|
608 |
@Override
|
|
609 |
public void installPackageProviders(SimpleTaskStatus taskStatus) {
|
|
610 |
Properties props = this.getProperties();
|
|
611 |
String ss = props.getProperty("installers");
|
|
612 |
if (ss == null) {
|
|
613 |
return;
|
|
614 |
}
|
|
615 |
|
|
616 |
try {
|
|
617 |
String[] installerNames = StringUtils.split(ss);
|
|
618 |
taskStatus.setRangeOfValues(0, installerNames.length);
|
|
619 |
int count=0;
|
|
620 |
for (String installerName : installerNames) {
|
|
621 |
taskStatus.message(installerName);
|
|
622 |
taskStatus.setCurValue(count++);
|
|
623 |
InstallerProviderInstallers installer = new InstallerProviderInstallers(this, installerName);
|
|
624 |
installer.install();
|
|
625 |
}
|
|
626 |
taskStatus.setCurValue(count++);
|
|
627 |
} finally {
|
|
628 |
taskStatus.terminate();
|
|
629 |
}
|
|
630 |
}
|
|
631 |
|
585 |
632 |
}
|