[mule-ide-dev] [550] branches/muleide-2.0.0/src/main/plugins/org.mule.ide.config.simple/src/org/mule/ide/config/simple/wizards/MuleConfigWizardPage.java: MULEIDE-162 (Creating a new config file overwrites existing files without warning)

View: New views
1 Messages — Rating Filter:   Alert me  

[mule-ide-dev] [550] branches/muleide-2.0.0/src/main/plugins/org.mule.ide.config.simple/src/org/mule/ide/config/simple/wizards/MuleConfigWizardPage.java: MULEIDE-162 (Creating a new config file overwrites existing files without warning)

by dirk-44 :: Rate this Message:

Reply (Restricted by the Administrator) | Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
[550] branches/muleide-2.0.0/src/main/plugins/org.mule.ide.config.simple/src/org/mule/ide/config/simple/wizards/MuleConfigWizardPage.java: MULEIDE-162 (Creating a new config file overwrites existing files without warning)
Revision
550
Author
dirk
Date
2009-11-07 19:24:55 -0600 (Sat, 07 Nov 2009)

Log Message

MULEIDE-162 (Creating a new config file overwrites existing files without warning)

Modified Paths

Diff

Modified: branches/muleide-2.0.0/src/main/plugins/org.mule.ide.config.simple/src/org/mule/ide/config/simple/wizards/MuleConfigWizardPage.java (549 => 550)

--- branches/muleide-2.0.0/src/main/plugins/org.mule.ide.config.simple/src/org/mule/ide/config/simple/wizards/MuleConfigWizardPage.java	2009-11-05 08:18:33 UTC (rev 549)
+++ branches/muleide-2.0.0/src/main/plugins/org.mule.ide.config.simple/src/org/mule/ide/config/simple/wizards/MuleConfigWizardPage.java	2009-11-08 01:24:55 UTC (rev 550)
@@ -315,10 +315,12 @@
 	}
 	
 	/**
-	 * Ensures that both text fields are set.
+	 * Check prerequsites for creating the new config file
 	 */
 	private void dialogChanged() {
-		IResource container = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(getFolderName()));
+		IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
+        Path folder = new Path(getFolderName());
+        IResource container = workspaceRoot.findMember(folder);
 		String fileName = getFileName();
 		
 		if (container.exists() == false) {
@@ -346,6 +348,13 @@
 				return;
 			}
 		}
+		
+		IPath destinationFile = folder.append(fileName);
+		if (workspaceRoot.exists(destinationFile)) {
+		    updateStatus("File already exists");
+		    return;
+		}
+		
 		updateStatus(null);
 	}
 


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "MuleForge Dev" group.
To post to this group, send email to muleforgedev@...
To unsubscribe from this group, send email to muleforgedev+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/muleforgedev?hl=en
-~----------~----~----~----~------~----~------~--~---
--------------------------------------------------------------------- To unsubscribe from this list, please visit: http://admin.muleforge.org/manage_email