mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 07:05:24 +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:
parent
e39e96bd9c
commit
8f5356e6cd
1 changed files with 12 additions and 7 deletions
|
@ -65,14 +65,19 @@ public abstract class UNCPathConverter {
|
|||
*/
|
||||
public static IPath toPath(URI uri) {
|
||||
IPath localPath = URIUtil.toPath(uri);
|
||||
String host = uri.getHost();
|
||||
// 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 {
|
||||
if (localPath != null) {
|
||||
return localPath;
|
||||
}
|
||||
// see if the uri has an authority part
|
||||
String part = uri.getAuthority();
|
||||
if (part == null) {
|
||||
// see if the uri has a host part
|
||||
part = uri.getHost();
|
||||
if (part == null) {
|
||||
return localPath;
|
||||
}
|
||||
}
|
||||
return new Path(part).makeUNC(true).append(uri.getPath());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue