summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMianrui Chai2012-04-23 23:56:32 (EDT)
committer Linda Chan2012-08-01 18:35:42 (EDT)
commitaddc73063f6ee904f561311e2d0ff40b58cfb66b (patch)
treebc94ea63ca683374d81d98772b65a72924e5c81d
parent3c540a8c3dc182b6d901b5b11d73edcc5bc241d1 (diff)
downloadorg.eclipse.datatools.connectivity-addc73063f6ee904f561311e2d0ff40b58cfb66b.zip
org.eclipse.datatools.connectivity-addc73063f6ee904f561311e2d0ff40b58cfb66b.tar.gz
org.eclipse.datatools.connectivity-addc73063f6ee904f561311e2d0ff40b58cfb66b.tar.bz2
[377460] Unable to specify an ODA connection profile store file with embedded space character
-rw-r--r--plugins/org.eclipse.datatools.connectivity.oda.design.ui/src/org/eclipse/datatools/connectivity/oda/design/internal/ui/profile/browse/ProfilePathSelectionDialog.java20
-rw-r--r--plugins/org.eclipse.datatools.connectivity.oda.design/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.datatools.connectivity.oda.design/src/org/eclipse/datatools/connectivity/oda/design/util/DesignUtil.java11
3 files changed, 23 insertions, 10 deletions
diff --git a/plugins/org.eclipse.datatools.connectivity.oda.design.ui/src/org/eclipse/datatools/connectivity/oda/design/internal/ui/profile/browse/ProfilePathSelectionDialog.java b/plugins/org.eclipse.datatools.connectivity.oda.design.ui/src/org/eclipse/datatools/connectivity/oda/design/internal/ui/profile/browse/ProfilePathSelectionDialog.java
index 1f4a95e..29018da 100644
--- a/plugins/org.eclipse.datatools.connectivity.oda.design.ui/src/org/eclipse/datatools/connectivity/oda/design/internal/ui/profile/browse/ProfilePathSelectionDialog.java
+++ b/plugins/org.eclipse.datatools.connectivity.oda.design.ui/src/org/eclipse/datatools/connectivity/oda/design/internal/ui/profile/browse/ProfilePathSelectionDialog.java
@@ -1,6 +1,6 @@
/*
*************************************************************************
- * Copyright (c) 2011 Actuate Corporation.
+ * Copyright (c) 2011, 2012 Actuate Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,6 +17,7 @@ import java.io.File;
import java.io.FileFilter;
import java.io.Serializable;
import java.net.URI;
+import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
@@ -442,9 +443,20 @@ public class ProfilePathSelectionDialog extends ElementTreeSelectionDialog
path = f.getParentFile().toURI().toString() + txtFileContent;
else
path = f.toURI( ).toString() + txtFileContent;
- URI filePath = URI.create(path);
- URI relative = topDir.toURI( ).relativize( filePath );
- result.add( relative.getPath( ) );
+
+ String relativePath;
+ try
+ {
+ URI filePath = new URI( null, null, path, null );
+ URI relative = topDir.toURI( ).relativize( filePath );
+ relativePath = relative.getPath( );
+ }
+ catch( URISyntaxException ex )
+ {
+ // ignore, use the full path of the selected item instead
+ relativePath = path;
+ }
+ result.add( relativePath );
}
else if ( !isProfileStoreCreation && f.isFile( ) )
{
diff --git a/plugins/org.eclipse.datatools.connectivity.oda.design/META-INF/MANIFEST.MF b/plugins/org.eclipse.datatools.connectivity.oda.design/META-INF/MANIFEST.MF
index 73ad245..ce94927 100644
--- a/plugins/org.eclipse.datatools.connectivity.oda.design/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.datatools.connectivity.oda.design/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.datatools.connectivity.oda.design; singleton:=true
-Bundle-Version: 3.3.4.qualifier
+Bundle-Version: 3.3.5.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.datatools.connectivity.oda.design,
diff --git a/plugins/org.eclipse.datatools.connectivity.oda.design/src/org/eclipse/datatools/connectivity/oda/design/util/DesignUtil.java b/plugins/org.eclipse.datatools.connectivity.oda.design/src/org/eclipse/datatools/connectivity/oda/design/util/DesignUtil.java
index 0670a5d..1d86236 100644
--- a/plugins/org.eclipse.datatools.connectivity.oda.design/src/org/eclipse/datatools/connectivity/oda/design/util/DesignUtil.java
+++ b/plugins/org.eclipse.datatools.connectivity.oda.design/src/org/eclipse/datatools/connectivity/oda/design/util/DesignUtil.java
@@ -1,6 +1,6 @@
/**
*************************************************************************
- * Copyright (c) 2006, 2011 Actuate Corporation.
+ * Copyright (c) 2006, 2012 Actuate Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -529,10 +529,11 @@ public class DesignUtil
File resolvedFile;
try
{
- // replace with directory separator syntax required by URI#resolve
- filePath = filePath.replace( File.separator, "/" ); //$NON-NLS-1$
- resolvedFile = new File( designResourceIds.getApplResourceBaseURI().resolve( filePath ) );
- }
+ // as URI requires specific syntax, use URI constructor to
+ // encode the filePath string into valid URI syntax
+ java.net.URI filePathURI = new java.net.URI( null, null, filePath, null );
+ resolvedFile = new File( designResourceIds.getApplResourceBaseURI().resolve( filePathURI ) );
+ }
catch( Exception ex )
{
getLogger().info( getExceptionMessage(ex) + " (" + filePath + ")" ); //$NON-NLS-1$ //$NON-NLS-2$