Home | History | Annotate | Download | only in utils

Lines Matching refs:systemId

30  * This class is used to resolve relative URIs and SystemID 
109 * Return true if the systemId denotes an absolute URI .
111 * @param systemId The systemId string
112 * @return true if the systemId is an an absolute URI
114 public static boolean isAbsoluteURI(String systemId)
122 * %REVIEW% Can we assume here that systemId is a valid URI?
127 if(isWindowsAbsolutePath(systemId)){
131 final int fragmentIndex = systemId.indexOf('#');
132 final int queryIndex = systemId.indexOf('?');
133 final int slashIndex = systemId.indexOf('/');
134 final int colonIndex = systemId.indexOf(':');
137 int index = systemId.length() -1;
152 * @param systemId The path string
155 public static boolean isAbsolutePath(String systemId)
157 if(systemId == null)
159 final File file = new File(systemId);
167 * @param systemId The path string
170 private static boolean isWindowsAbsolutePath(String systemId)
172 if(!isAbsolutePath(systemId))
175 if (systemId.length() > 2
176 && systemId.charAt(1) == ':'
177 && Character.isLetter(systemId.charAt(0))
178 && (systemId.charAt(2) == '\\' || systemId.charAt(2) == '/'))
217 * Take a SystemID string and try to turn it into a good absolute URI.
219 * @param systemId A URI string, which may be absolute or relative.
223 public static String getAbsoluteURI(String systemId)
225 String absoluteURI = systemId;
226 if (isAbsoluteURI(systemId))
228 // Only process the systemId if it starts with "file:".
229 if (systemId.startsWith("file:"))
231 String str = systemId.substring(5);
233 // Resolve the absolute path if the systemId starts with "file:///"
241 int secondColonIndex = systemId.indexOf(':', 5);
244 String localPath = systemId.substring(secondColonIndex-1);
247 absoluteURI = systemId.substring(0, secondColonIndex-1) +
251 return systemId;
258 return getAbsoluteURIFromRelative(systemId.substring(5));
264 return systemId;
267 return getAbsoluteURIFromRelative(systemId);
273 * Take a SystemID string and try to turn it into a good absolute URI.
275 * @param urlString SystemID string
276 * @param base The URI string used as the base for resolving the systemID