mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 15:15:25 +02:00
[233373] NPE when deleting a file from a read-only folder on Local
This commit is contained in:
parent
788cece9b2
commit
5d71236868
1 changed files with 12 additions and 8 deletions
|
@ -38,6 +38,7 @@
|
|||
* Martin Oberhuber (Wind River) - [226262] Make IService IAdaptable
|
||||
* David McKnight (IBM) - [231211] Local xml file not opened when workspace encoding is different from local system encoding
|
||||
* Radoslav Gerganov (ProSyst) - [230919] IFileService.delete() should not return a boolean
|
||||
* David McKnight (IBM) - [233373] NPE when deleting a file from a read-only folder on Local
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.services.local.files;
|
||||
|
@ -1047,14 +1048,17 @@ public class LocalFileService extends AbstractFileService implements ILocalServi
|
|||
{
|
||||
result = fileToDelete.delete();
|
||||
}
|
||||
if (!result) {
|
||||
if (fileToDelete.exists()) {
|
||||
// Deletion failed without specification why... likely a Security
|
||||
// problem?
|
||||
throw new RemoteFileSecurityException(null);
|
||||
} else {
|
||||
throw new SystemElementNotFoundException(fileToDelete.getAbsolutePath(), "delete"); //$NON-NLS-1$
|
||||
}
|
||||
if (!result){
|
||||
if (fileToDelete.exists()) {
|
||||
// Deletion failed without specification why... likely a Security
|
||||
// problem?
|
||||
// TODO we'll want to wrap a message with the IOException at some point after
|
||||
// 3.0.1
|
||||
throw new RemoteFileSecurityException(new IOException());
|
||||
}
|
||||
else {
|
||||
throw new SystemElementNotFoundException(fileToDelete.getAbsolutePath(), "delete"); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue