platform independent file URL
authorAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Tue, 21 Sep 2010 07:27:29 +0000 (07:27 +0000)
committerAndreas Kohlbecker <a.kohlbecker@bgbm.org>
Tue, 21 Sep 2010 07:27:29 +0000 (07:27 +0000)
taxeditor-store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportWizard.java

index 9ddc978cd9d0752a9f2c318c6a14284070d36323..6efb0d3c59407afc16c70169d7deaa5a9b2c74bc 100644 (file)
 
 package eu.etaxonomy.taxeditor.io.wizard;
 
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+
 import org.apache.log4j.Logger;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IWorkbench;
@@ -43,20 +48,21 @@ public class AbcdImportWizard extends AbstractImportWizard<Abcd206ImportConfigur
         */
        @Override
        public boolean performFinish() {
-               String file = dataSourcePage.getFile();
+               String platformDependendFile = dataSourcePage.getFile();
                
                // AbcdImport expects a string that can be used to instantiate a URL instance
                // TODO consolidate import and exports regarding what may be passed in as source
                // will construct a url string for now
                
-               file = "file://" + file;
+               File file = new File(platformDependendFile);
+               URI fileUri  = file.toURI();
                
-               configurator.setSource(file);
+               configurator.setSource(fileUri.toString());
                configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
                
                CdmStore.getImportHandler().run(configurator);
-               
                return true;
+               
        }
 
        /* (non-Javadoc)