javamanager/javainstaller/installer/javasrc/com/nokia/mj/impl/installer/midp2/install/steps/ConfirmInstallation.java
equal
deleted
inserted
replaced
124 |
124 |
125 // Set installation drive. |
125 // Set installation drive. |
126 installInfo.setDriveId(ball.iInstallationDrive); |
126 installInfo.setDriveId(ball.iInstallationDrive); |
127 Vector drives = new Vector(); |
127 Vector drives = new Vector(); |
128 SysUtil.getUserVisibleDrives(drives); |
128 SysUtil.getUserVisibleDrives(drives); |
|
129 removeFullDrives(ball, drives); |
129 int[] driveIds = new int[drives.size()]; |
130 int[] driveIds = new int[drives.size()]; |
130 int[] driveTypes = new int[drives.size()]; |
131 int[] driveTypes = new int[drives.size()]; |
131 long[] driveFreeSpaces = new long[drives.size()]; |
132 long[] driveFreeSpaces = new long[drives.size()]; |
132 for (int i = 0; i < drives.size(); i++) |
133 for (int i = 0; i < drives.size(); i++) |
133 { |
134 { |
383 attrValue + " failed", nfe); |
384 attrValue + " failed", nfe); |
384 } |
385 } |
385 } |
386 } |
386 return size; |
387 return size; |
387 } |
388 } |
|
389 |
|
390 /** |
|
391 * Removes drives which do not have enough free space for the |
|
392 * application from the aDrives vector. |
|
393 */ |
|
394 private void removeFullDrives(InstallBall aBall, Vector aDrives) |
|
395 { |
|
396 int requiredSize = CheckDiskSpace.getRequiredSize(aBall); |
|
397 for (int i = 0; i < aDrives.size(); i++) |
|
398 { |
|
399 DriveInfo drive = (DriveInfo)aDrives.elementAt(i); |
|
400 int driveId = drive.getNumber(); |
|
401 if (SysUtil.isDiskSpaceBelowCriticalLevel(requiredSize, driveId)) |
|
402 { |
|
403 Log.logWarning("Drive " + FileUtils.getDriveName(driveId) + |
|
404 " (" + driveId + ") does not have enough " + |
|
405 " free space, required space " + requiredSize + |
|
406 " bytes"); |
|
407 aDrives.removeElementAt(i); |
|
408 i--; // Decrease index because drive was removed from Vector. |
|
409 } |
|
410 } |
|
411 if (aDrives.size() == 0) |
|
412 { |
|
413 // None of the available drives has enough space, |
|
414 // throw an exception. |
|
415 throw InstallerException.getOutOfDiskSpaceException( |
|
416 requiredSize, null); |
|
417 } |
|
418 } |
388 } |
419 } |