summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBin Feng2011-12-07 23:00:15 (EST)
committerLinda Chan2011-12-07 23:00:15 (EST)
commit7a6389e7c7a048d35205133c9883519b426bedad (patch)
tree76063a9cee57ac0e61bd7e4d2b4d38da3764faf2
parent052fe79904fd0c238d3664402848c8bb905e63d1 (diff)
downloadorg.eclipse.datatools.enablement.oda-7a6389e7c7a048d35205133c9883519b426bedad.zip
org.eclipse.datatools.enablement.oda-7a6389e7c7a048d35205133c9883519b426bedad.tar.gz
org.eclipse.datatools.enablement.oda-7a6389e7c7a048d35205133c9883519b426bedad.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/src/org/eclipse/datatools/connectivity/oda/flatfile/ResourceLocator.java26
1 files changed, 15 insertions, 11 deletions
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 );
}