Author: fbricon
Date: 2011-10-05 18:17:13 -0400 (Wed, 05 Oct 2011)
New Revision: 35402
Modified:
trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/dialog/MaterializeLibraryDialog.java
trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/handlers/MaterializeLibraryHandler.java
Log:
JBIDE-8972 : check if destination folder is valid
Modified:
trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/dialog/MaterializeLibraryDialog.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/dialog/MaterializeLibraryDialog.java 2011-10-05
21:58:25 UTC (rev 35401)
+++
trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/dialog/MaterializeLibraryDialog.java 2011-10-05
22:17:13 UTC (rev 35402)
@@ -246,6 +246,14 @@
selectedClasspathEntryPaths.put(entry.getKey().getPath(),entry.getValue());
}
+ String ancestorPath = libFolder.getFullPath().segment(0);
+ IResource ancestor =
ResourcesPlugin.getWorkspace().getRoot().findMember(ancestorPath);
+ if (ancestor == null || !ancestor.exists()) {
+ setErrorMessage(ancestorPath + " does not exist ");
+ return;
+ }
+
+
Set<String> duplicates = findDuplicates(selectedClasspathEntryPaths.values());
if (!duplicates.isEmpty()) {
setErrorMessage("Duplicate entries found : "+duplicates.toString());
Modified:
trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/handlers/MaterializeLibraryHandler.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/handlers/MaterializeLibraryHandler.java 2011-10-05
21:58:25 UTC (rev 35401)
+++
trunk/common/plugins/org.jboss.tools.common.jdt.ui/src/org/jboss/tools/common/jdt/ui/buildpath/handlers/MaterializeLibraryHandler.java 2011-10-05
22:17:13 UTC (rev 35402)
@@ -109,6 +109,8 @@
Display.getDefault().asyncExec(new Runnable() {
public void run() {
Shell shell = HandlerUtil.getActiveShell(event);
+ Throwable e = result.getException();
+ if (e != null) e.printStackTrace();
MessageDialogWithToggle.openError(shell, NLS.bind("Error Materializing
{0}", libName), result.getMessage());
}
});
Show replies by date