Bug 138190 [Wizards] Save As doesn't check validity of location
Build id: N20060424-0010 1) Create project "P1" containing file "a.txt" 2) Open the editor on a.txt 3) File > Save As 4) In the "File name" field, enter "c:\temp\a.txt" (I was somehow thinking I could save the file in the file system from here). 5) Click Ok. It creates a file /P1/temp/a.txt I would have expected an error in the wizard as soon as I entered the ":" character, which is not a valid character in file names on windows.
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/WizardNewFileCreationPage.java
contents = new ByteArrayInputStream(new byte[0]);
		}
        try {
            
            if (linkTargetPath != null) {
				fileHandle.createLink(linkTargetPath,
                        IResource.ALLOW_MISSING_LOCAL, monitor);
			} else {
                IPath path = fileHandle.getFullPath();
                IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
                int numSegments= path.segmentCount();
                if (numSegments > 2 && !root.getFolder(path.removeLastSegments(1)).exists()) {
                    
                    
                    for (int i= numSegments - 2; i > 0; i--) {
                        IFolder folder = root.getFolder(path.removeLastSegments(i));
                        if (!folder.exists()) {
                            folder.create(false, true, monitor);
                        }
                    }
                }
                fileHandle.create(contents, false, monitor);
            }
        } catch (CoreException e) {
            
            if (e.getStatus().getCode() == IResourceStatus.PATH_OCCUPIED) {
				fileHandle.refreshLocal(IResource.DEPTH_ZERO, null);
			} else {
				throw e;
			}