mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-16 21:45:22 +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
|
* 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
|
* 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
|
* 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;
|
package org.eclipse.rse.internal.services.local.files;
|
||||||
|
@ -1047,14 +1048,17 @@ public class LocalFileService extends AbstractFileService implements ILocalServi
|
||||||
{
|
{
|
||||||
result = fileToDelete.delete();
|
result = fileToDelete.delete();
|
||||||
}
|
}
|
||||||
if (!result) {
|
if (!result){
|
||||||
if (fileToDelete.exists()) {
|
if (fileToDelete.exists()) {
|
||||||
// Deletion failed without specification why... likely a Security
|
// Deletion failed without specification why... likely a Security
|
||||||
// problem?
|
// problem?
|
||||||
throw new RemoteFileSecurityException(null);
|
// TODO we'll want to wrap a message with the IOException at some point after
|
||||||
} else {
|
// 3.0.1
|
||||||
throw new SystemElementNotFoundException(fileToDelete.getAbsolutePath(), "delete"); //$NON-NLS-1$
|
throw new RemoteFileSecurityException(new IOException());
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
throw new SystemElementNotFoundException(fileToDelete.getAbsolutePath(), "delete"); //$NON-NLS-1$
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue