From 69bf47f7ae21f61f42f70a0ae9304407ec58dc11 Mon Sep 17 00:00:00 2001 From: Xuan Chen Date: Sat, 11 Aug 2007 03:26:56 +0000 Subject: [PATCH] [191548] fix Deleting Read-Only directory removes it from view and displays no error --- .../miners/UniversalFileSystemMiner.java | 3 +++ .../dstore/files/DStoreFileService.java | 20 +++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java index 1326a0332b3..d4fa075043b 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java @@ -22,6 +22,7 @@ * Xuan Chen (IBM) - [198046] [dstore] Cannot copy a folder into an archive file * Xuan Chen (IBM) - [191367] with supertransfer on, Drag & Drop Folder from DStore to DStore doesn't work * Martin Oberhuber (Wind River) - [199548] Avoid touching files on setReadOnly() if unnecessary + * Kevin Doyle (IBM) - [191548] Deleting Read-Only directory removes it from view and displays no error *******************************************************************************/ package org.eclipse.rse.dstore.universal.miners; @@ -957,6 +958,7 @@ public class UniversalFileSystemMiner extends Miner { DataElement parent = subject.getParent(); _dataStore.deleteObject(parent, subject); _dataStore.refresh(parent); + status.setAttribute(DE.A_SOURCE, IServiceConstants.SUCCESS + "|" + deleteObj.getAbsolutePath()); //$NON-NLS-1$ } } else { UniversalServerUtilities @@ -2136,6 +2138,7 @@ public class UniversalFileSystemMiner extends Miner { DataElement parent = subject.getParent(); _dataStore.deleteObject(parent, subject); _dataStore.refresh(parent); + status.setAttribute(DE.A_SOURCE, IServiceConstants.SUCCESS); } } diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java index ce5e68c7d59..fc7f55b559f 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java @@ -17,6 +17,7 @@ * Kushal Munir (IBM) - [189352] Replace with appropriate line end character on upload * David McKnight (IBM) - [190803] Canceling a long-running dstore job prints "InterruptedException" to stdout * David McKnight (IBM) - [196035] Wrapper SystemMessageExceptions for createFile and createFolder with RemoteFileSecurityException + * Kevin Doyle (IBM) - [191548] Deleting Read-Only directory removes it from view and displays no error ********************************************************************************/ package org.eclipse.rse.internal.services.dstore.files; @@ -928,16 +929,11 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer DataElement de = getElementFor(remotePath); DataElement status = dsStatusCommand(de, IUniversalDataStoreConstants.C_DELETE, monitor); if (status == null) return false; - if (de.getType().equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR)) - { - if (FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.SUCCESS)) return true; - else throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); //$NON-NLS-1$ - } - else - { + if (FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.SUCCESS)) { return true; + } else { + throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); //$NON-NLS-1$ } - } public boolean deleteBatch(String[] remoteParents, String[] fileNames, IProgressMonitor monitor) throws SystemMessageException @@ -953,9 +949,11 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer } DataElement status = dsStatusCommand((DataElement) dataElements.get(0), dataElements, IUniversalDataStoreConstants.C_DELETE_BATCH, monitor); if (status == null) return false; - if (FileSystemMessageUtil.getSourceMessage(status).startsWith(IServiceConstants.FAILED)) - throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); //$NON-NLS-1$ - else return true; + if (FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.SUCCESS)) { + return true; + } else { + throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); //$NON-NLS-1$ + } } public boolean rename(String remoteParent, String oldName, String newName, IProgressMonitor monitor) throws SystemMessageException