Refine search
public Document getDocument(String wsdl) throws ToolException { try { URI wsdlURI = new URI(URIParserUtil.getAbsoluteURI(wsdl)); if (wsdlURI.toString().startsWith("http")) { return getDocument(wsdlURI.toURL()); } return getDocument(wsdlURI.toURL()); } catch (ToolException e) { throw e; } catch (Exception e) { throw new ToolException(e); } }
try { url = new URL(uri); result = escapeChars(url.toURI().normalize().toString().replace("\\", "/")); } catch (MalformedURLException e1) { try { return file.toURI().normalize().toString(); return escapeChars(url.toString().replace("\\", "/")); } catch (Exception e2) { return escapeChars(uri.replace("\\", "/")); result = escapeChars(url.toString().replace("\\", "/"));
public static String getAbsoluteURI(final String arg) { if (arg == null) { return null; } try { URI uri = new URI(arg); if ("file".equalsIgnoreCase(uri.getScheme())) { if (!uri.isOpaque()) { return uri.normalize().toString(); } return new File("").toURI().resolve(uri.getPath()).toString(); } return normalize(arg); } catch (Exception e2) { return normalize(arg); } }
return null; if (baseURI.isAbsolute() ^ toBeRelativizedURI.isAbsolute()) { return null; final String base = baseURI.getSchemeSpecificPart(); final String toBeRelativized = toBeRelativizedURI.getSchemeSpecificPart(); final int l1 = base.length(); String rResolved = new URI(getRoot(sb.toString())).relativize(new URI(toBeRelativized)).toString(); StringBuilder relativizedPath = new StringBuilder(); for (int i = 0; i < slashes; i++) {
env.put(ToolConstants.CFG_WSDLURL, URIParserUtil.getAbsoluteURI(wsdl)); if (!env.containsKey(ToolConstants.CFG_WSDLLOCATION)) { URI uri = new URI(wsdl); String uriScheme = uri.getScheme(); if (uriScheme == null) { assumeFileURI = true; wsdl = uri.toString(); } catch (Exception e) { bindingFiles[i] = URIParserUtil.getAbsoluteURI(bindingFiles[i]);
private String getAbsoluteURI(String uri, String bindingFile) { URI locURI = null; try { locURI = new URI(uri); } catch (URISyntaxException e) { Message msg = new Message("BINDING_LOC_ERROR", LOG, new Object[] {uri}); throw new ToolException(msg); } if (!locURI.isAbsolute()) { try { String base = URIParserUtil.getAbsoluteURI(bindingFile); URI baseURI = new URI(base); locURI = baseURI.resolve(locURI); } catch (URISyntaxException e) { Message msg = new Message("NOT_URI", LOG, new Object[] {bindingFile}); throw new ToolException(msg, e); } } return locURI.toString(); }
if (currentSchema.equals(rs) && !rsURI.equals(k)) { try { String p = URIParserUtil.relativize(rsURI, resolvedSchemaLocation); if (p != null) { path = new URI(k).resolve(p).toString(); break;
public static String relativize(String base, String toBeRelativized) throws URISyntaxException { if (base == null || toBeRelativized == null) { return null; } return relativize(new URI(base), new URI(toBeRelativized)); }
String wsdlUrl = URIParserUtil.getAbsoluteURI((String)context.get(ToolConstants.CFG_WSDLURL)); if (wsdlUrl.contains("/")) { wsdlUrl = wsdlUrl.substring(wsdlUrl.lastIndexOf('/')); String path = bindingFiles[0]; try { File file = new File(new java.net.URI(bindingFiles[0])); if (file.exists()) { path = file.getAbsolutePath();
public URI[] getDependencyURIs(URI baseURI) { if (dependencies == null) { return null; } URI[] uris = new URI[dependencies.length]; for (int i = 0; i < dependencies.length; i++) { File file = new File(dependencies[i]); uris[i] = file.exists() ? file.toURI() : baseURI .resolve(URIParserUtil.escapeChars(dependencies[i])); } return uris; }
protected String getCatalogURL() { String catalogLocation = (String) context.get(ToolConstants.CFG_CATALOG); return URIParserUtil.getAbsoluteURI(catalogLocation); } }
env.put(ToolConstants.CFG_WSDLURL, URIParserUtil.normalize(wsdl)); bindingFiles[i] = URIParserUtil.getAbsoluteURI(bindingFiles[i]);
List<String> tokens = tokenize(nameSpaceURI, "/: "); if (tokens.size() == 0) { return "cxf"; domain = domain.substring(0, idx); List<String> r = reverse(tokenize(domain, "urn".equals(scheme) ? ".-" : ".")); if ("www".equalsIgnoreCase(r.get(r.size() - 1))) { token = removeIllegalIdentifierChars(token); if (containsReservedKeywords(token)) { token = '_' + token; return combine(tokens, '.');
public static String escapeChars(String s) { StringBuilder b = new StringBuilder(s.length()); for (int x = 0; x < s.length(); x++) { char ch = s.charAt(x); if (isExcluded(ch)) { byte[] bytes = Character.toString(ch).getBytes(StandardCharsets.UTF_8); for (int y = 0; y < bytes.length; y++) { b.append("%"); b.append(HEX_DIGITS.charAt((bytes[y] & 0xFF) >> 4)); b.append(HEX_DIGITS.charAt(bytes[y] & 0x0F)); } } else { b.append(ch); } } return b.toString(); } public static String normalize(final String uri) {
return null; if (baseURI.isAbsolute() ^ toBeRelativizedURI.isAbsolute()) { return null; final String base = baseURI.getSchemeSpecificPart(); final String toBeRelativized = toBeRelativizedURI.getSchemeSpecificPart(); final int l1 = base.length(); String rResolved = new URI(getRoot(sb.toString())).relativize(new URI(toBeRelativized)).toString(); StringBuilder relativizedPath = new StringBuilder(); for (int i = 0; i < slashes; i++) {
env.put(ToolConstants.CFG_WSDLURL, URIParserUtil.getAbsoluteURI(wsdl)); if (!env.containsKey(ToolConstants.CFG_WSDLLOCATION)) { URI uri = new URI(wsdl); String uriScheme = uri.getScheme(); if (uriScheme == null) { assumeFileURI = true; wsdl = uri.toString(); } catch (Exception e) { bindingFiles[i] = URIParserUtil.getAbsoluteURI(bindingFiles[i]);
if (currentSchema.equals(rs) && !rsURI.equals(k)) { try { String p = URIParserUtil.relativize(rsURI, resolvedSchemaLocation); if (p != null) { path = new URI(k).resolve(p).toString(); break;
public static String relativize(String base, String toBeRelativized) throws URISyntaxException { if (base == null || toBeRelativized == null) { return null; } return relativize(new URI(base), new URI(toBeRelativized)); }
private URI getWadlURI(URI baseURI, String wadlLocation) { File wadlFile = new File(wadlLocation); return wadlFile.exists() ? wadlFile.toURI() : baseURI.resolve(URIParserUtil.escapeChars(wadlLocation)); }
protected String getCatalogURL() { String catalogLocation = (String) context.get(ToolConstants.CFG_CATALOG); return URIParserUtil.getAbsoluteURI(catalogLocation); } }