Lines 8-13
Link Here
|
8 |
* Contributors: |
8 |
* Contributors: |
9 |
* QNX Software Systems - initial API and implementation |
9 |
* QNX Software Systems - initial API and implementation |
10 |
* Markus Schorn (Wind River Systems) |
10 |
* Markus Schorn (Wind River Systems) |
|
|
11 |
* Ed Swartz (Nokia) |
11 |
*******************************************************************************/ |
12 |
*******************************************************************************/ |
12 |
package org.eclipse.cdt.utils; |
13 |
package org.eclipse.cdt.utils; |
13 |
|
14 |
|
Lines 41-53
Link Here
|
41 |
} |
42 |
} |
42 |
|
43 |
|
43 |
public static IPath getCanonicalPath(IPath fullPath) { |
44 |
public static IPath getCanonicalPath(IPath fullPath) { |
|
|
45 |
if (!fullPath.isAbsolute()) |
46 |
return fullPath; |
47 |
|
44 |
File file = fullPath.toFile(); |
48 |
File file = fullPath.toFile(); |
45 |
try { |
49 |
try { |
46 |
String canonPath = file.getCanonicalPath(); |
50 |
String canonPath = file.getCanonicalPath(); |
47 |
return new Path(canonPath); |
51 |
IPath canonicalPath = new Path(canonPath); |
|
|
52 |
if (fullPath.getDevice() == null) |
53 |
canonicalPath = canonicalPath.setDevice(null); |
54 |
return canonicalPath; |
48 |
} catch (IOException ex) { |
55 |
} catch (IOException ex) { |
49 |
} |
56 |
} |
50 |
return null; |
57 |
return fullPath; |
51 |
} |
58 |
} |
52 |
|
59 |
|
53 |
public static IPath getWorkspaceRelativePath(IPath fullPath) { |
60 |
public static IPath getWorkspaceRelativePath(IPath fullPath) { |