1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Bug 445149 - Check the authority section when converting a URI to a UNC

path

Change-Id: If0ee8b57bd938d6a7e8aa755668e3c742c2f8ab2
Signed-off-by: Greg Watson <g.watson@computer.org>
This commit is contained in:
Greg Watson 2014-09-29 14:38:24 -04:00 committed by Gerrit Code Review @ Eclipse.org
parent f3781679fa
commit 33c37b7d11

View file

@ -65,14 +65,19 @@ public abstract class UNCPathConverter {
*/ */
public static IPath toPath(URI uri) { public static IPath toPath(URI uri) {
IPath localPath = URIUtil.toPath(uri); IPath localPath = URIUtil.toPath(uri);
String host = uri.getHost(); if (localPath != null) {
// try local path first
// that'll give EFS a chance to resolve a custom protocol path.
if (host != null && localPath == null) {
return new Path(host + uri.getPath()).makeUNC(true);
} else {
return localPath; return localPath;
} }
// see if the uri has an host part
String host = uri.getHost();
if (host == null) {
// see if the uri has a authority part
host = uri.getAuthority();
if (host == null) {
return localPath;
}
}
return new Path(host).makeUNC(true).append(uri.getPath());
} }
/** /**