View | Details | Raw Unified | Return to bug 191548 | Differences between
and this patch

Collapse All | Expand All

(-)miners/org/eclipse/rse/dstore/universal/miners/UniversalFileSystemMiner.java (-1 / +1 lines)
Lines 2123-2129 Link Here
2123
					.getRegisteredHandler(new File(vpath
2123
					.getRegisteredHandler(new File(vpath
2124
							.getContainingArchiveString()));
2124
							.getContainingArchiveString()));
2125
			if (handler == null || !handler.delete(vpath.getVirtualPart())) {
2125
			if (handler == null || !handler.delete(vpath.getVirtualPart())) {
2126
				status.setAttribute(DE.A_SOURCE, IServiceConstants.FAILED);
2126
				status.setAttribute(DE.A_SOURCE, IServiceConstants.FAILED + "|" + vpath.toString()); //$NON-NLS-1$
2127
				_dataStore.refresh(subject);
2127
				_dataStore.refresh(subject);
2128
				return statusDone(status);
2128
				return statusDone(status);
2129
			}
2129
			}
(-)src/org/eclipse/rse/internal/services/dstore/files/DStoreFileService.java (-2 / +4 lines)
Lines 929-935 Link Here
929
		DataElement de = getElementFor(remotePath);
929
		DataElement de = getElementFor(remotePath);
930
		DataElement status = dsStatusCommand(de, IUniversalDataStoreConstants.C_DELETE, monitor);
930
		DataElement status = dsStatusCommand(de, IUniversalDataStoreConstants.C_DELETE, monitor);
931
		if (status == null) return false;
931
		if (status == null) return false;
932
		if (FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.SUCCESS)) {
932
		String sourceMsg = FileSystemMessageUtil.getSourceMessage(status);
933
		if (sourceMsg.equals(IServiceConstants.SUCCESS) || sourceMsg.equals("")) { //$NON-NLS-1$
933
			return true;
934
			return true;
934
		} else {
935
		} else {
935
			throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status)));	 //$NON-NLS-1$
936
			throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status)));	 //$NON-NLS-1$
Lines 949-955 Link Here
949
		}	
950
		}	
950
		DataElement status = dsStatusCommand((DataElement) dataElements.get(0), dataElements, IUniversalDataStoreConstants.C_DELETE_BATCH, monitor);
951
		DataElement status = dsStatusCommand((DataElement) dataElements.get(0), dataElements, IUniversalDataStoreConstants.C_DELETE_BATCH, monitor);
951
		if (status == null) return false;
952
		if (status == null) return false;
952
		if (FileSystemMessageUtil.getSourceMessage(status).equals(IServiceConstants.SUCCESS)) {
953
		String sourceMsg = FileSystemMessageUtil.getSourceMessage(status);
954
		if (sourceMsg.equals(IServiceConstants.SUCCESS) || sourceMsg.equals("")) { //$NON-NLS-1$
953
			return true;
955
			return true;
954
		} else {
956
		} else {
955
			throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status)));	 //$NON-NLS-1$
957
			throw new SystemMessageException(getMessage("RSEF1300").makeSubstitution(FileSystemMessageUtil.getSourceLocation(status)));	 //$NON-NLS-1$
(-)src/org/eclipse/rse/internal/services/dstore/files/DStoreHostFile.java (-22 / +39 lines)
Lines 15-20 Link Here
15
 * {Name} (company) - description of contribution.
15
 * {Name} (company) - description of contribution.
16
 * Xuan Chen        (IBM)   - [189041] incorrect file name after rename a file inside a zip file - DStore Windows
16
 * Xuan Chen        (IBM)   - [189041] incorrect file name after rename a file inside a zip file - DStore Windows
17
 * Xuan Chen        (IBM)   - [187548] Editor shows incorrect file name after renaming file on Linux dstore
17
 * Xuan Chen        (IBM)   - [187548] Editor shows incorrect file name after renaming file on Linux dstore
18
 * Kevin Doyle 		(IBM) 	- [191548] Various NPE fixes 
18
 *******************************************************************************/
19
 *******************************************************************************/
19
20
20
package org.eclipse.rse.internal.services.dstore.files;
21
package org.eclipse.rse.internal.services.dstore.files;
Lines 90-96 Link Here
90
		{
91
		{
91
			// filter doesn't separate path from name
92
			// filter doesn't separate path from name
92
			String path = _element.getName();
93
			String path = _element.getName();
93
			return getNameFromPath(path);
94
			// if path is null then the file has been deleted
95
			if (path != null) { 
96
				return getNameFromPath(path);
97
			} else
98
			{
99
				return path;
100
			}
94
		}
101
		}
95
		else if (isRoot())
102
		else if (isRoot())
96
		{
103
		{
Lines 99-121 Link Here
99
		else
106
		else
100
		{
107
		{
101
			String name = _element.getName();
108
			String name = _element.getName();
102
			String parentPath = getParentPath();
109
			// if name is null then the file has been deleted
103
			if (name.length() == 0 && 
110
			if (name != null)
104
					(parentPath.equals("/")  || parentPath.endsWith(":\\"))) //$NON-NLS-1$ //$NON-NLS-2$
105
			{
106
				
107
				return parentPath;
108
			}
109
			if (name.length() == 0)
110
			{
111
			{
111
				String path = _element.getValue();
112
				String parentPath = getParentPath();
112
				int lastSep = path.lastIndexOf('/');
113
				if (name.length() == 0 && 
113
				if (lastSep == -1)
114
						(parentPath.equals("/")  || parentPath.endsWith(":\\"))) //$NON-NLS-1$ //$NON-NLS-2$
114
					lastSep = path.lastIndexOf('\\');
115
				{
115
				name = path.substring(lastSep + 1);
116
					
116
				return name;
117
					return parentPath;
118
				}
119
				if (name.length() == 0)
120
				{
121
					String path = _element.getValue();
122
					int lastSep = path.lastIndexOf('/');
123
					if (lastSep == -1)
124
						lastSep = path.lastIndexOf('\\');
125
					name = path.substring(lastSep + 1);
126
					return name;
127
				}
117
			}
128
			}
118
			
119
			return name;
129
			return name;
120
		}
130
		}
121
	}
131
	}
Lines 127-137 Link Here
127
		{
137
		{
128
			// filter doesn't separate path from name
138
			// filter doesn't separate path from name
129
			String path = _element.getName();
139
			String path = _element.getName();
130
			return getParentPathFromPath(path);
140
			// path is null if the file has been deleted.
141
			if (path != null) {
142
				return getParentPathFromPath(path);
143
			} else {
144
				return path;
145
			}			
131
		}
146
		}
132
		else
147
		else
133
		{
148
		{
134
			if (_element.getName().length() == 0)
149
			// Name can be null if file has been deleted
150
			if (_element.getName() != null && _element.getName().length() == 0)
135
			{
151
			{
136
				// derive from value
152
				// derive from value
137
				String fullPath = _element.getValue();
153
				String fullPath = _element.getValue();
Lines 192-201 Link Here
192
	{
208
	{
193
		String parentPath = _element.getValue();
209
		String parentPath = _element.getValue();
194
		String name = _element.getName();
210
		String name = _element.getName();
195
		if (parentPath == null || 
211
		// If name is null then file has been deleted
212
		if (name != null && (parentPath == null || 
196
				parentPath.length() == 0 || 
213
				parentPath.length() == 0 || 
197
				(name.length() == 0 && (parentPath.equals("/") || parentPath.endsWith(":\\")) || //$NON-NLS-1$ //$NON-NLS-2$
214
				(name.length() == 0 && (parentPath.equals("/") || parentPath.endsWith(":\\")) || //$NON-NLS-1$ //$NON-NLS-2$
198
				(name.equals(parentPath) && parentPath.endsWith(":\\"))) //$NON-NLS-1$ 
215
				(name.equals(parentPath) && parentPath.endsWith(":\\")))) //$NON-NLS-1$ 
199
				)
216
				)
200
						
217
						
201
		{
218
		{
Lines 210-218 Link Here
210
	public boolean isFile()
227
	public boolean isFile()
211
	{
228
	{
212
		String type = _element.getType();
229
		String type = _element.getType();
213
		if (type != null && type.equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR)
230
		if (type != null && (type.equals(IUniversalDataStoreConstants.UNIVERSAL_FILE_DESCRIPTOR)
214
				|| type.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR)
231
				|| type.equals(IUniversalDataStoreConstants.UNIVERSAL_VIRTUAL_FILE_DESCRIPTOR)
215
				|| type.equals(IUniversalDataStoreConstants.UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR))
232
				|| type.equals(IUniversalDataStoreConstants.UNIVERSAL_ARCHIVE_FILE_DESCRIPTOR)))
216
		{
233
		{
217
			return true;
234
			return true;
218
		}
235
		}

Return to bug 191548