mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-03 22:35:43 +02:00
bug 388755: Added extra check for schema "file" while fixing path "/C:/path" on Windows in EFSExtensionProvider
This commit is contained in:
parent
1de79e8703
commit
8fb2b6a3c6
1 changed files with 7 additions and 3 deletions
|
@ -13,6 +13,7 @@ package org.eclipse.cdt.core;
|
|||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import org.eclipse.core.filesystem.EFS;
|
||||
import org.eclipse.core.runtime.Path;
|
||||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.core.runtime.URIUtil;
|
||||
|
@ -56,9 +57,12 @@ public abstract class EFSExtensionProvider {
|
|||
*/
|
||||
public String getPathFromURI(URI locationURI) {
|
||||
String path = locationURI.getPath();
|
||||
// URI path on Windows is represented as "/C:/path"
|
||||
if (path != null && Platform.getOS().equals(Platform.WS_WIN32) && path.matches("/[A-Za-z]:.*")) { //$NON-NLS-1$
|
||||
path = path.substring(1);
|
||||
String schema = locationURI.getScheme();
|
||||
if (schema != null && schema.equals(EFS.SCHEME_FILE) && Platform.getOS().equals(Platform.WS_WIN32)) {
|
||||
// URI path on Windows is represented as "/C:/path"
|
||||
if (path != null && path.matches("/[A-Za-z]:.*")) { //$NON-NLS-1$
|
||||
path = path.substring(1);
|
||||
}
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue