mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Fix Bug 378882 - CDT projects not working when managed by custom EFS
filesystem Change-Id: I6e0966b63c5be81cb35008edb3cd9218023aaf3e Reviewed-on: https://git.eclipse.org/r/7184 Reviewed-by: Chris Recoskie <recoskie@ca.ibm.com> IP-Clean: Chris Recoskie <recoskie@ca.ibm.com> Tested-by: Chris Recoskie <recoskie@ca.ibm.com>
This commit is contained in:
parent
e658da36e5
commit
30c3237227
1 changed files with 9 additions and 4 deletions
|
@ -58,18 +58,23 @@ public abstract class UNCPathConverter {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert a URI to an IPath. If URI has a host section, return a UNC rather than a file based path.
|
* Convert a URI to an IPath.
|
||||||
|
* Resolves to local path if possible, including using EFS where required.
|
||||||
*
|
*
|
||||||
* @param uri
|
* @param uri
|
||||||
* URI to convert to an IPath
|
* URI to convert to an IPath
|
||||||
* @return IPath representation of the URI
|
* @return IPath representation of the URI
|
||||||
*/
|
*/
|
||||||
public static IPath toPath(URI uri) {
|
public static IPath toPath(URI uri) {
|
||||||
|
IPath localPath = URIUtil.toPath(uri);
|
||||||
String host = uri.getHost();
|
String host = uri.getHost();
|
||||||
if (host != 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);
|
return new Path(host + uri.getPath()).makeUNC(true);
|
||||||
}
|
} else {
|
||||||
return URIUtil.toPath(uri);
|
return localPath;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue