Community
Participate
Working Groups
In a case-insensitive platform like Windows, IFile.exists() only checks the existence with exact case. FileResourcesUtils.makeFile() will create a new file even if a file with the same name but different case exists. So we get a CoreException with IResourceStatus.CASE_VARIANT_EXISTS. makeFile() needs to handle that and overwrites the file with the same name but different case. I will attach a patch later.
Created attachment 107240 [details] proposed patch This proposed patch changes the FileResourceUtils.makeFile in org.eclipse.wst.command.env and org.eclipse.wst.common.environment. The new logic is like this: if the file doesn't not exist try create the file return the file catch IResourceStatus.CASE_VARIANT_EXISTS CoreException find the existing file with a variant case reset file name to the name of the existing file When this point is reached, it means we have an existing file that we need to overwrite. Just overwrite the file using the original logic.
Tests that have been done on Windows using adopter runtime: 1. Existing WSDL file with a different case - passed 2. Existing WSDL file with the same case - passed 3. Non existing WSDL file - passed Tests to be run: 4. Existing WSDL file locked by notepad - ? 5. Repeat with other DD file like webservices.xml or java files. Tests haven't been run on linux yet. The above tests exercise the changes in org.eclipse.wst.common.internal.environment.eclipse.FileResourceUtils. The same set of tests need to be run using the AXIS runtime to test the changes in org.eclipse.wst.command.internal.env.common.FileResourceUtils.
Peter, Could you please review the patch from Raymond and take over the testing of this patch on Linux? Thanks!
Patch reviewed and tested by Peter. It had been committed and released as v200807161459.
This defect has been in resolve state for a while. Please verify this with the appropriate WTP driver which can be found in: http://download.eclipse.org/webtools/downloads/ We would verify and close the defect on the originator's behalf if it has not been verified 2 weeks after it's been changed to Verified state.
This bug has been in resolved state for a while. Please verify this defect with the latest WTP 3.0.4 or WTP 3.5 build from: http://download.eclipse.org/webtools/downloads/ If this is not verified within 2 weeks, we'll be verifying the bug on your behalf. Thanks!
closed