summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkwilk2011-04-19 17:06:58 (EDT)
committer Ryan D. Brooks2011-04-19 17:06:58 (EDT)
commit68839a659aca8338df5d2d2c511c6a8eb1de2b36 (patch)
tree1fe7ae9853a44e8f284732e9b93872f755074087
parent43ff3a28075e1fa63ebc15e9199d236d0eba4dc7 (diff)
downloadorg.eclipse.osee-68839a659aca8338df5d2d2c511c6a8eb1de2b36.zip
org.eclipse.osee-68839a659aca8338df5d2d2c511c6a8eb1de2b36.tar.gz
org.eclipse.osee-68839a659aca8338df5d2d2c511c6a8eb1de2b36.tar.bz2
bug[bgz_343312]: Fix for artifact import with invalid path
-rw-r--r--plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/DirectoryOrFileSelector.java13
1 files changed, 5 insertions, 8 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/DirectoryOrFileSelector.java b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/DirectoryOrFileSelector.java
index c789338..b5379c2 100644
--- a/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/DirectoryOrFileSelector.java
+++ b/plugins/org.eclipse.osee.framework.ui.plugin/src/org/eclipse/osee/framework/ui/plugin/util/DirectoryOrFileSelector.java
@@ -110,15 +110,12 @@ public class DirectoryOrFileSelector extends Composite implements Listener {
btnSingleFile.setEnabled(!directorySelected);
}
+ /**
+ * @return new File if path is valid, null otherwise.
+ */
public File getFile() {
- File file;
- if (isDirectorySelected()) {
- file = new File(txtDirectory.getText());
- } else {
- file = new File(txtSingleFile.getText());
- }
-
- return file;
+ String path = isDirectorySelected() ? txtDirectory.getText() : txtSingleFile.getText();
+ return Strings.isValid(path) ? new File(path) : null;
}
public String getText() {