|
Lines 26-32
Link Here
|
| 26 |
|
26 |
|
| 27 |
public class ComponentResolver implements URIResolverExtension { |
27 |
public class ComponentResolver implements URIResolverExtension { |
| 28 |
private static boolean _DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.wst.common.modulecore/ComponentResolver")); //$NON-NLS-1$ //$NON-NLS-2$ |
28 |
private static boolean _DEBUG = "true".equals(Platform.getDebugOption("org.eclipse.wst.common.modulecore/ComponentResolver")); //$NON-NLS-1$ //$NON-NLS-2$ |
| 29 |
private static final String FILE_PROTOCOL = "file://"; //$NON-NLS-1$ |
29 |
private static final String FILE_PROTOCOL = "file:///"; //$NON-NLS-1$ |
|
|
30 |
private static final String FILE_PROTOCOL2 = "file://"; //$NON-NLS-1$ |
| 30 |
private static final String ROOT_PATH_STRING = Path.ROOT.toString(); //$NON-NLS-1$ |
31 |
private static final String ROOT_PATH_STRING = Path.ROOT.toString(); //$NON-NLS-1$ |
| 31 |
|
32 |
|
| 32 |
/** |
33 |
/** |
|
Lines 46-51
Link Here
|
| 46 |
if (uri.startsWith(FILE_PROTOCOL)) { |
47 |
if (uri.startsWith(FILE_PROTOCOL)) { |
| 47 |
location = uri.substring(FILE_PROTOCOL.length()); |
48 |
location = uri.substring(FILE_PROTOCOL.length()); |
| 48 |
} |
49 |
} |
|
|
50 |
else if (uri.startsWith(FILE_PROTOCOL2)) { |
| 51 |
location = uri.substring(FILE_PROTOCOL2.length()); |
| 52 |
} |
| 49 |
else { |
53 |
else { |
| 50 |
location = uri; |
54 |
location = uri; |
| 51 |
} |
55 |
} |
|
Lines 62-68
Link Here
|
| 62 |
|
66 |
|
| 63 |
public String resolve(IFile file, String baseLocation, String publicId, String systemId) { |
67 |
public String resolve(IFile file, String baseLocation, String publicId, String systemId) { |
| 64 |
if (_DEBUG) { |
68 |
if (_DEBUG) { |
| 65 |
System.out.print("ComponentResolver: resolve \"[" + publicId + "/" + systemId + "]\" from \"" + baseLocation + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
69 |
System.out.print("ComponentResolver: resolve \"[{" + publicId + "}{" + systemId + "}]\" from \"" + baseLocation + "\""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ |
| 66 |
} |
70 |
} |
| 67 |
/* |
71 |
/* |
| 68 |
* Check for a system reference; without one, there's no point in |
72 |
* Check for a system reference; without one, there's no point in |
|
Lines 113-118
Link Here
|
| 113 |
} |
117 |
} |
| 114 |
|
118 |
|
| 115 |
boolean prependFilePrefix = baseLocation.startsWith(FILE_PROTOCOL) && baseLocation.length() > 7; |
119 |
boolean prependFilePrefix = baseLocation.startsWith(FILE_PROTOCOL) && baseLocation.length() > 7; |
|
|
120 |
boolean prependFilePrefix2 = baseLocation.startsWith(FILE_PROTOCOL2) && baseLocation.length() > 8; |
| 116 |
|
121 |
|
| 117 |
String resolvedPath = null; |
122 |
String resolvedPath = null; |
| 118 |
IVirtualResource[] virtualResources = ComponentCore.createResources(file); |
123 |
IVirtualResource[] virtualResources = ComponentCore.createResources(file); |
|
Lines 132-137
Link Here
|
| 132 |
if (prependFilePrefix) { |
137 |
if (prependFilePrefix) { |
| 133 |
resolvedPath = FILE_PROTOCOL + resolvedFile.getLocation().toString(); |
138 |
resolvedPath = FILE_PROTOCOL + resolvedFile.getLocation().toString(); |
| 134 |
} |
139 |
} |
|
|
140 |
else if (prependFilePrefix2) { |
| 141 |
resolvedPath = FILE_PROTOCOL2 + resolvedFile.getLocation().toString(); |
| 142 |
} |
| 135 |
else { |
143 |
else { |
| 136 |
resolvedPath = resolvedFile.getLocation().toString(); |
144 |
resolvedPath = resolvedFile.getLocation().toString(); |
| 137 |
} |
145 |
} |