File tree 1 file changed +18
-5
lines changed
ilg.gnuarmeclipse.packs/src/ilg/gnuarmeclipse/packs/jobs
1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change 11
11
12
12
package ilg .gnuarmeclipse .packs .jobs ;
13
13
14
+ import ilg .gnuarmeclipse .core .Activator ;
14
15
import ilg .gnuarmeclipse .core .StringUtils ;
15
16
import ilg .gnuarmeclipse .packs .core .ConsoleStream ;
16
17
import ilg .gnuarmeclipse .packs .core .data .PacksStorage ;
@@ -258,11 +259,19 @@ private boolean installPack(Node versionNode) throws IOException {
258
259
Utils .deleteFolderRecursive (destFolder );
259
260
}
260
261
261
- // Extract all files from the archive to the local folder.
262
- if (!unzip (archiveFile , destRelPath )) {
262
+ boolean flag = false ;
263
+ try {
264
+ flag = unzip (archiveFile , destRelPath );
265
+ } catch (IOException e ) {
266
+ Activator .log (e );
267
+ }
263
268
269
+ // Extract all files from the archive to the local folder.
270
+ if (!flag ) {
264
271
fOut .println ("Install cancelled due to errors." );
265
272
273
+ // Remove partial install
274
+ Utils .deleteFolderRecursive (destFolder );
266
275
return false ;
267
276
}
268
277
@@ -342,9 +351,13 @@ private boolean unzip(File archiveFile, IPath destRelativePath)
342
351
343
352
zipInput .closeEntry ();
344
353
zipInput .close ();
345
- fOut .println (countFiles + " files written, "
346
- + StringUtils .convertSizeToString (countBytes ) + "." );
347
-
354
+ if (countBytes > 0 ) {
355
+ fOut .println (countFiles + " files written, "
356
+ + StringUtils .convertSizeToString (countBytes ) + "." );
357
+ } else {
358
+ fOut .println ("No files written." );
359
+ result = false ;
360
+ }
348
361
return result ;
349
362
}
350
363
You can’t perform that action at this time.
0 commit comments