|
24 | 24 | import org.eclipse.core.filesystem.EFS; |
25 | 25 | import org.eclipse.core.filesystem.IFileInfo; |
26 | 26 | import org.eclipse.core.filesystem.IFileStore; |
| 27 | +import org.eclipse.core.filesystem.provider.FileInfo; |
27 | 28 | import org.eclipse.core.internal.preferences.EclipsePreferences; |
28 | 29 | import org.eclipse.core.internal.utils.BitMask; |
29 | 30 | import org.eclipse.core.internal.utils.Messages; |
@@ -213,23 +214,13 @@ private void checkCreatable() throws CoreException { |
213 | 214 | private IFileInfo create(int updateFlags, SubMonitor subMonitor, IFileStore store) |
214 | 215 | throws CoreException, ResourceException { |
215 | 216 | String message; |
216 | | - IFileInfo localInfo = store.fetchInfo(); |
| 217 | + IFileInfo localInfo; |
217 | 218 | if (BitMask.isSet(updateFlags, IResource.FORCE)) { |
218 | | - if (!Workspace.caseSensitive) { |
219 | | - if (localInfo.exists()) { |
220 | | - String name = getLocalManager().getLocalName(store); |
221 | | - if (name == null || localInfo.getName().equals(name)) { |
222 | | - delete(true, null); |
223 | | - } else { |
224 | | - // The file system is not case sensitive and there is already a file |
225 | | - // under this location. |
226 | | - message = NLS.bind(Messages.resources_existsLocalDifferentCase, |
227 | | - IPath.fromOSString(store.toString()).removeLastSegments(1).append(name).toOSString()); |
228 | | - throw new ResourceException(IResourceStatus.CASE_VARIANT_EXISTS, getFullPath(), message, null); |
229 | | - } |
230 | | - } |
231 | | - } |
| 219 | + // Assume the file does not exist - otherwise implementation fails later |
| 220 | + // during actual write |
| 221 | + localInfo = new FileInfo(getName()); // with exists==false |
232 | 222 | } else { |
| 223 | + localInfo=store.fetchInfo(); |
233 | 224 | if (localInfo.exists()) { |
234 | 225 | // return an appropriate error message for case variant collisions |
235 | 226 | if (!Workspace.caseSensitive) { |
|
0 commit comments