public int getDefaultPort() { return this.getScheme().getPort(); }
@Override public int getDefaultPort() { return this.getScheme().getPort(); }
public String get(final Scheme scheme, final int port, final String username, final String hostname, final String path) { final String base = String.format("%s://%s%s%s", scheme, includeUsername && StringUtils.isNotEmpty(username) ? String.format("%s@", URIEncoder.encode(username)) : "", new PunycodeConverter().convert(hostname), port != scheme.getPort() ? String.format(":%d", port) : ""); if(includePath) { if(StringUtils.isNotBlank(path)) { return String.format("%s%s", base, PathNormalizer.normalize(path)); } } return base; } }
@Override public Host find(final Location.Name region, final boolean tls) { final Protocol protocol; if(tls) { protocol = new UDTTLSProtocol(); } else { protocol = new UDTProtocol(); } return new Host(protocol, String.format("%s.qloudsonic.io", region.getIdentifier()), protocol.getScheme().getPort()); }
list.add(new DescriptiveUrl(URI.create(String.format("%s://%s%s%s?temp_url_sig=%s&temp_url_expires=%d", scheme.name(), region.getStorageUrl().getHost(), port == -1 ? StringUtils.EMPTY : port == scheme.getPort() ? StringUtils.EMPTY : String.format(":%d", port), region.getStorageUrl( containerService.getContainer(file).getName(), containerService.getKey(file)).getRawPath(), signature, expiry)),
case 2: case 4: if(host.getPort() == Scheme.davs.getPort()) { host.setProtocol(protocols.forScheme(Scheme.davs));
url.append(bookmark.getProtocol().getScheme().toString()).append("://"); url.append(bookmark.getHostname()); if(!(bookmark.getProtocol().getScheme().getPort() == bookmark.getPort())) { url.append(":").append(bookmark.getPort());