private String toURL(final Host host) { StringBuilder url = new StringBuilder(host.getProtocol().getScheme().toString()); url.append("://"); url.append(new PunycodeConverter().convert(host.getHostname())); url.append(":").append(host.getPort()); return url.toString(); } }
final RegistryBuilder<ConnectionSocketFactory> registry = RegistryBuilder.create(); if(proxy.getProtocol().isSecure()) { registry.register(proxy.getProtocol().getScheme().toString(), new SSLConnectionSocketFactory( new CustomTrustSSLProtocolSocketFactory(trust, key), new DisabledX509HostnameVerifier() { registry.register(proxy.getProtocol().getScheme().toString(), new PlainConnectionSocketFactory() { @Override public Socket createSocket(final HttpContext context) throws IOException { registry.register(Scheme.https.toString(), new SSLConnectionSocketFactory( new CustomTrustSSLProtocolSocketFactory(trust, key), new DisabledX509HostnameVerifier()
@Override public DescriptiveUrlBag toUrl(final Path file) { final String nodeid = file.isDirectory() ? file.attributes().getVersionId() : file.getParent().attributes().getVersionId(); if(StringUtils.isBlank(nodeid)) { return DescriptiveUrlBag.empty(); } return new DescriptiveUrlBag(Collections.singletonList( new DescriptiveUrl(URI.create(String.format("%s/#/node/%s", new HostUrlProvider().withUsername(false).get(session.getHost()), URIEncoder.encode( nodeid ))), DescriptiveUrl.Type.http, MessageFormat.format(LocaleFactory.localizedString("{0} URL"), session.getHost().getProtocol().getScheme().toString().toUpperCase(Locale.ROOT))) )); } }
@Override public DescriptiveUrlBag toUrl(final Path file) { final DescriptiveUrlBag list = new DescriptiveUrlBag(); if(file.attributes().getLink() != null) { list.add(file.attributes().getLink()); } list.add(new DescriptiveUrl(URI.create(String.format("%s%s", new HostUrlProvider().withUsername(false).get(host), URIEncoder.encode(file.getAbsolute()))), DescriptiveUrl.Type.provider, MessageFormat.format(LocaleFactory.localizedString("{0} URL"), host.getProtocol().getScheme().toString().toUpperCase(Locale.ROOT)))); list.addAll(new WebUrlProvider(host).toUrl(file)); return list; } }
public Set<? extends AuthenticationRequest> getRequest(final Host bookmark, final LoginCallback prompt) throws LoginCanceledException { final StringBuilder url = new StringBuilder(); url.append(bookmark.getProtocol().getScheme().toString()).append("://"); url.append(bookmark.getHostname()); if(!(bookmark.getProtocol().getScheme().getPort() == bookmark.getPort())) {