Revision 36117 branches/v2_0_0_prep/extensions/org.gvsig.installer/org.gvsig.installer.lib/org.gvsig.installer.lib.impl/src/main/java/org/gvsig/installer/lib/impl/utils/Decompress.java
Decompress.java | ||
---|---|---|
107 | 107 |
decompressFolderOfPluginFromPackage(is, name); |
108 | 108 |
} |
109 | 109 |
|
110 |
public class InstallerPluginReadException extends InstallPackageServiceException { |
|
110 |
public class InstallerPluginReadException extends |
|
111 |
InstallPackageServiceException { |
|
111 | 112 |
|
112 | 113 |
private static final long serialVersionUID = -6065359474790792680L; |
113 | 114 |
|
... | ... | |
137 | 138 |
|
138 | 139 |
private static final long serialVersionUID = 4505298394252120334L; |
139 | 140 |
|
140 |
private static final String message = "Error reading the plugin '%(name)s'"; |
|
141 |
private static final String message = |
|
142 |
"Error reading the plugin '%(name)s'"; |
|
141 | 143 |
|
142 | 144 |
private static final String KEY = "_Error_reading_the_plugin"; |
143 | 145 |
|
... | ... | |
193 | 195 |
ZipEntry entry = null; |
194 | 196 |
|
195 | 197 |
String name = ""; |
196 |
|
|
198 |
|
|
197 | 199 |
try { |
198 | 200 |
while ((entry = zipInputStream.getNextEntry()) != null) { |
199 | 201 |
name = entry.getName(); |
200 |
if (entry.getName().equals("defaultPackages")) { |
|
202 |
if (entry.getName().equals("defaultPackages") |
|
203 |
|| entry.getName().equals("defaultSelection")) { |
|
201 | 204 |
int count; |
202 | 205 |
byte data[] = new byte[BUFFER]; |
203 | 206 |
ByteArrayOutputStream out = new ByteArrayOutputStream(); |
... | ... | |
237 | 240 |
throw new InstallerPluginReadErrorException(e, name); |
238 | 241 |
} |
239 | 242 |
} |
240 |
|
|
243 |
|
|
241 | 244 |
private void decompressFolderOfPluginFromPackage(InputStream is, String name) |
242 | 245 |
throws InstallPackageServiceException { |
243 | 246 |
|
... | ... | |
258 | 261 |
throw new InstallerPluginReadErrorException(e, name); |
259 | 262 |
} |
260 | 263 |
} |
261 |
|
|
264 |
|
|
262 | 265 |
private void readPlugin(InputStream is, String zipEntryName) |
263 | 266 |
throws ZipException, IOException, InstallerInfoFileException { |
264 | 267 |
ZipEntry entry = null; |
... | ... | |
281 | 284 |
} |
282 | 285 |
zis.closeEntry(); |
283 | 286 |
} |
284 |
// Don't close the stream as if it is a zip file contained
|
|
287 |
// Don't close the stream as if it is a zip file contained |
|
285 | 288 |
// into another zip file, closing of the child Zip?nputStream |
286 | 289 |
// will close also the parent's. |
287 |
// zis.close();
|
|
290 |
// zis.close();
|
|
288 | 291 |
|
289 | 292 |
if (installerInfoNumber == zipEntriesMap.size()) { |
290 | 293 |
PackageInfo installerInfo = new DefaultPackageInfo(); |
... | ... | |
295 | 298 |
} |
296 | 299 |
} |
297 | 300 |
|
298 |
private void decompressPlugin(InputStream inputStream) |
|
299 |
throws ZipException, IOException, InstallerInfoFileException {
|
|
301 |
private void decompressPlugin(InputStream inputStream) throws ZipException,
|
|
302 |
IOException, InstallerInfoFileException { |
|
300 | 303 |
ZipInputStream zis = null; |
301 | 304 |
ZipEntry entry = null; |
302 | 305 |
byte data[] = new byte[BUFFER]; |
... | ... | |
406 | 409 |
return InstallerProviderLocator.getProviderManager() |
407 | 410 |
.getPackageInfoFileName(); |
408 | 411 |
} |
409 |
|
|
412 |
|
|
410 | 413 |
public List<String> getDefaultSelectedPackages() { |
411 | 414 |
return defaultSelectedPackets; |
412 | 415 |
} |
Also available in: Unified diff