### Eclipse Workspace Patch 1.0 #P org.eclipse.rse.services.dstore Index: miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java,v retrieving revision 1.21 diff -u -r1.21 UniversalFileSystemMiner.java --- miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java 11 Aug 2007 03:26:56 -0000 1.21 +++ miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java 15 Aug 2007 13:37:49 -0000 @@ -2123,7 +2123,7 @@ .getRegisteredHandler(new File(vpath .getContainingArchiveString())); if (handler == null || !handler.delete(vpath.getVirtualPart())) { - status.setAttribute(DE.A_SOURCE, IServiceConstants.FAILED); + status.setAttribute(DE.A_SOURCE, IServiceConstants.FAILED + "|" + vpath.toString()); //$NON-NLS-1$ _dataStore.refresh(subject); return statusDone(status); } Index: src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java,v retrieving revision 1.16 diff -u -r1.16 DStoreFileService.java --- src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java 11 Aug 2007 03:26:56 -0000 1.16 +++ src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java 15 Aug 2007 13:37:49 -0000 @@ -929,7 +929,8 @@ DataElement de = getElementFor(remotePath); DataElement status = dsStatusCommand(de, IUniversalDataStoreConstants.C_DELETE, monitor); if (status == null) return false; - if (FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.SUCCESS)) { + String sourceMsg = FileSystemMessageUtil.getSourceMessage(status); + if (sourceMsg.equals(IServiceConstants.SUCCESS) || sourceMsg.equals("")) { //$NON-NLS-1$ return true; } else { throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); //$NON-NLS-1$ @@ -949,7 +950,8 @@ } DataElement status = dsStatusCommand((DataElement) dataElements.get(0), dataElements, IUniversalDataStoreConstants.C_DELETE_BATCH, monitor); if (status == null) return false; - if (FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.SUCCESS)) { + String sourceMsg = FileSystemMessageUtil.getSourceMessage(status); + if (sourceMsg.equals(IServiceConstants.SUCCESS) || sourceMsg.equals("")) { //$NON-NLS-1$ return true; } else { throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status))); //$NON-NLS-1$ Index: src/org/eclipse/rse/internal/services/dstore/files/DStoreHostFile.java =================================================================== RCS file: /cvsroot/dsdp/org.eclipse.tm.rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/internal/services/dstore/files/DStoreHostFile.java,v retrieving revision 1.11 diff -u -r1.11 DStoreHostFile.java --- src/org/eclipse/rse/internal/services/dstore/files/DStoreHostFile.java 24 Jul 2007 19:18:47 -0000 1.11 +++ src/org/eclipse/rse/internal/services/dstore/files/DStoreHostFile.java 15 Aug 2007 13:37:49 -0000 @@ -15,6 +15,7 @@ * {Name} (company) - description of contribution. * Xuan Chen (IBM) - [189041] incorrect file name after rename a file inside a zip file - DStore Windows * Xuan Chen (IBM) - [187548] Editor shows incorrect file name after renaming file on Linux dstore + * Kevin Doyle (IBM) - [191548] Various NPE fixes *******************************************************************************/ package org.eclipse.rse.internal.services.dstore.files; @@ -90,7 +91,13 @@ { // filter doesn't separate path from name String path = _element.getName(); - return getNameFromPath(path); + // if path is null then the file has been deleted + if (path != null) { + return getNameFromPath(path); + } else + { + return path; + } } else if (isRoot()) { @@ -99,23 +106,26 @@ else { String name = _element.getName(); - String parentPath = getParentPath(); - if (name.length() == 0 && - (parentPath.equals("/") || parentPath.endsWith(":\\"))) //$NON-NLS-1$ //$NON-NLS-2$ - { - - return parentPath; - } - if (name.length() == 0) + // if name is null then the file has been deleted + if (name != null) { - String path = _element.getValue(); - int lastSep = path.lastIndexOf('/'); - if (lastSep == -1) - lastSep = path.lastIndexOf('\\'); - name = path.substring(lastSep + 1); - return name; + String parentPath = getParentPath(); + if (name.length() == 0 && + (parentPath.equals("/") || parentPath.endsWith(":\\"))) //$NON-NLS-1$ //$NON-NLS-2$ + { + + return parentPath; + } + if (name.length() == 0) + { + String path = _element.getValue(); + int lastSep = path.lastIndexOf('/'); + if (lastSep == -1) + lastSep = path.lastIndexOf('\\'); + name = path.substring(lastSep + 1); + return name; + } } - return name; } } @@ -127,11 +137,17 @@ { // filter doesn't separate path from name String path = _element.getName(); - return getParentPathFromPath(path); + // path is null if the file has been deleted. + if (path != null) { + return getParentPathFromPath(path); + } else { + return path; + } } else { - if (_element.getName().length() == 0) + // Name can be null if file has been deleted + if (_element.getName() != null && _element.getName().length() == 0) { // derive from value String fullPath = _element.getValue(); @@ -192,10 +208,11 @@ { String parentPath = _element.getValue(); String name = _element.getName(); - if (parentPath == null || + // If name is null then file has been deleted + if (name != null && (parentPath == null || parentPath.length() == 0 || (name.length() == 0 && (parentPath.equals("/") || parentPath.endsWith(":\\")) || //$NON-NLS-1$ //$NON-NLS-2$ - (name.equals(parentPath) && parentPath.endsWith(":\\"))) //$NON-NLS-1$ + (name.equals(parentPath) && parentPath.endsWith(":\\")))) //$NON-NLS-1$ ) { @@ -210,9 +227,9 @@ public boolean isFile() { String type = _element.getType(); - if (type != null && type.equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR) + if (type != null && (type.equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR) || type.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR) - || type.equals(IUniversalDataStoreConstants.UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR)) + || type.equals(IUniversalDataStoreConstants.UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR))) { return true; }