summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBin Feng2011-12-07 23:00:15 (EST)
committer Linda Chan2011-12-07 23:00:15 (EST)
commitaa2eb43e6bade2f1d8d50bf3aab744fb10ee6984 (patch)
tree629dae9bf0a2d2d6c8975abe2157717c9829e649
parent634fa5edec1ece12f9c302a86ed66bd2508e28e1 (diff)
downloadorg.eclipse.datatools.connectivity-aa2eb43e6bade2f1d8d50bf3aab744fb10ee6984.zip
org.eclipse.datatools.connectivity-aa2eb43e6bade2f1d8d50bf3aab744fb10ee6984.tar.gz
org.eclipse.datatools.connectivity-aa2eb43e6bade2f1d8d50bf3aab744fb10ee6984.tar.bz2
Fixed logic in resolving Windows local relative path; disabled relative path support in DSE [43693, 45393]v201112081200
-rw-r--r--plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/wizards/FolderSelectionPageHelper.java2
-rw-r--r--plugins/org.eclipse.datatools.connectivity.oda.flatfile/src/org/eclipse/datatools/connectivity/oda/flatfile/ResourceLocator.java26
2 files changed, 15 insertions, 13 deletions
diff --git a/plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/wizards/FolderSelectionPageHelper.java b/plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/wizards/FolderSelectionPageHelper.java
index 0f46fdc..c6438b5 100644
--- a/plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/wizards/FolderSelectionPageHelper.java
+++ b/plugins/org.eclipse.datatools.connectivity.oda.flatfile.ui/src/org/eclipse/datatools/connectivity/oda/flatfile/ui/wizards/FolderSelectionPageHelper.java
@@ -302,8 +302,6 @@ public class FolderSelectionPageHelper
charSetSelectionCombo.select( 0 );
else
charSetSelectionCombo.select( charSetSelectionCombo.indexOf( charSet ) );
-
- verifyFileLocation( );
}
/**
diff --git a/plugins/org.eclipse.datatools.connectivity.oda.flatfile/src/org/eclipse/datatools/connectivity/oda/flatfile/ResourceLocator.java b/plugins/org.eclipse.datatools.connectivity.oda.flatfile/src/org/eclipse/datatools/connectivity/oda/flatfile/ResourceLocator.java
index 359a3b9..b31cf38 100644
--- a/plugins/org.eclipse.datatools.connectivity.oda.flatfile/src/org/eclipse/datatools/connectivity/oda/flatfile/ResourceLocator.java
+++ b/plugins/org.eclipse.datatools.connectivity.oda.flatfile/src/org/eclipse/datatools/connectivity/oda/flatfile/ResourceLocator.java
@@ -117,17 +117,8 @@ public final class ResourceLocator
{
URI uri = null;
File file = new File(fileURI);
- if ( file.isAbsolute( ) )
+ if ( file.exists( ) )
{
- if ( !file.exists( ) )
- {
- throw new InvalidResourceException( InvalidResourceException.ERROR_INVALID_RESOURCE,
- MessageFormat.format( Messages.getString( "connection_CANNOT_OPEN_FLAT_FILE_URI" ), //$NON-NLS-1$
- new Object[]{
- fileURI,
- new FileNotFoundException( )
- } ) );
- }
uri = file.toURI( );
}
else
@@ -141,11 +132,24 @@ public final class ResourceLocator
uri = new URI( null, null, convertURI( fileURI ), null );
}
- if ( !uri.isAbsolute( ) && resourceIdentifiers != null )
+ if ( uri.isAbsolute() )
+ {
+ ; // Already resolved, do nothing.
+ }
+ else if ( !uri.isAbsolute( ) && resourceIdentifiers != null )
{
URI uriResolved = ResourceIdentifiers.resolveApplResource( resourceIdentifiers, uri );
uri = uriResolved == null ? uri : uriResolved;
}
+ else
+ {
+ throw new InvalidResourceException( InvalidResourceException.ERROR_INVALID_RESOURCE,
+ MessageFormat.format( Messages.getString( "connection_CANNOT_OPEN_FLAT_FILE_URI" ), //$NON-NLS-1$
+ new Object[]{
+ fileURI,
+ new FileNotFoundException( )
+ } ) );
+ }
}
stream = new ResourceInputStream( uri.toURL( ).openStream( ), fileURI );
}