if (isAbsoluteURI(systemId)) if (!isAbsolutePath(localPath)) absoluteURI = systemId.substring(0, secondColonIndex-1) + getAbsolutePathFromRelativePath(localPath); return getAbsoluteURIFromRelative(systemId.substring(5)); return replaceChars(absoluteURI); return getAbsoluteURIFromRelative(systemId);
/** * Take a SystemID string and try to turn it into a good absolute URI. * * @param urlString SystemID string * @param base The URI string used as the base for resolving the systemID * * @return The resolved absolute URI * @throws TransformerException thrown if the string can't be turned into a URI. */ public static String getAbsoluteURI(String urlString, String base) throws TransformerException { if (base == null) return getAbsoluteURI(urlString); String absoluteBase = getAbsoluteURI(base); URI uri = null; try { URI baseURI = new URI(absoluteBase); uri = new URI(baseURI, urlString); } catch (MalformedURIException mue) { throw new TransformerException(mue); } return replaceChars(uri.toString()); }
if(isWindowsAbsolutePath(systemId)){ return false;
if (!isAbsolutePath(localPath)) absolutePath = getAbsolutePathFromRelativePath(localPath); urlString = "file:" + localPath; return replaceChars(urlString);
SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName); } else { try { absoluteEntitiesFileName = SystemIDResolver.getAbsoluteURI(entitiesFileName, null); } catch (TransformerException te) { throw new WrappedRuntimeException(te);
String absoluteURI = SystemIDResolver.getAbsoluteURI(uri);
/** * Return true if the local path is a Windows absolute path. * * @param systemId The path string * @return true if the path is a Windows absolute path */ private static boolean isWindowsAbsolutePath(String systemId) { if(!isAbsolutePath(systemId)) return false; // On Windows, an absolute path starts with "[drive_letter]:\". if (systemId.length() > 2 && systemId.charAt(1) == ':' && Character.isLetter(systemId.charAt(0)) && (systemId.charAt(2) == '\\' || systemId.charAt(2) == '/')) return true; else return false; }
if (!isAbsolutePath(localPath)) absolutePath = getAbsolutePathFromRelativePath(localPath); urlString = "file:" + localPath; return replaceChars(urlString);
SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName); } else { try { absoluteEntitiesFileName = SystemIDResolver.getAbsoluteURI(entitiesFileName, null); } catch (TransformerException te) { throw new WrappedRuntimeException(te);
String absoluteURI = SystemIDResolver.getAbsoluteURI(uri);
/** * Return true if the local path is a Windows absolute path. * * @param systemId The path string * @return true if the path is a Windows absolute path */ private static boolean isWindowsAbsolutePath(String systemId) { if(!isAbsolutePath(systemId)) return false; // On Windows, an absolute path starts with "[drive_letter]:\". if (systemId.length() > 2 && systemId.charAt(1) == ':' && Character.isLetter(systemId.charAt(0)) && (systemId.charAt(2) == '\\' || systemId.charAt(2) == '/')) return true; else return false; }
if (isAbsoluteURI(systemId)) if (!isAbsolutePath(localPath)) absoluteURI = systemId.substring(0, secondColonIndex-1) + getAbsolutePathFromRelativePath(localPath); return getAbsoluteURIFromRelative(systemId.substring(5)); return replaceChars(absoluteURI); return getAbsoluteURIFromRelative(systemId);
if (!isAbsolutePath(localPath)) absolutePath = getAbsolutePathFromRelativePath(localPath); urlString = "file:" + localPath; return replaceChars(urlString);
/** * Take a SystemID string and try to turn it into a good absolute URI. * * @param urlString SystemID string * @param base The URI string used as the base for resolving the systemID * * @return The resolved absolute URI * @throws TransformerException thrown if the string can't be turned into a URI. */ public static String getAbsoluteURI(String urlString, String base) throws TransformerException { if (base == null) return getAbsoluteURI(urlString); String absoluteBase = getAbsoluteURI(base); URI uri = null; try { URI baseURI = new URI(absoluteBase); uri = new URI(baseURI, urlString); } catch (MalformedURIException mue) { throw new TransformerException(mue); } return replaceChars(uri.toString()); }
SystemIDResolver.getAbsoluteURIFromRelative(entitiesFileName); } else { try { absoluteEntitiesFileName = SystemIDResolver.getAbsoluteURI(entitiesFileName, null); } catch (TransformerException te) { throw new WrappedRuntimeException(te);
String absoluteURI = SystemIDResolver.getAbsoluteURI(uri);
/** * Return true if the local path is a Windows absolute path. * * @param systemId The path string * @return true if the path is a Windows absolute path */ private static boolean isWindowsAbsolutePath(String systemId) { if(!isAbsolutePath(systemId)) return false; // On Windows, an absolute path starts with "[drive_letter]:\". if (systemId.length() > 2 && systemId.charAt(1) == ':' && Character.isLetter(systemId.charAt(0)) && (systemId.charAt(2) == '\\' || systemId.charAt(2) == '/')) return true; else return false; }
if(isWindowsAbsolutePath(systemId)){ return false;
if (isAbsoluteURI(systemId)) if (!isAbsolutePath(localPath)) absoluteURI = systemId.substring(0, secondColonIndex-1) + getAbsolutePathFromRelativePath(localPath); return getAbsoluteURIFromRelative(systemId.substring(5)); return replaceChars(absoluteURI); return getAbsoluteURIFromRelative(systemId);
if (!isAbsolutePath(localPath)) absolutePath = getAbsolutePathFromRelativePath(localPath); urlString = "file:" + localPath; return replaceChars(urlString);