/** * @param protocol Scheme */ public Host(final Protocol protocol) { this(protocol, protocol.getDefaultHostname()); }
@Override public String getDefaultHostname() { final String v = this.value("Default Hostname"); if(StringUtils.isBlank(v)) { return parent.getDefaultHostname(); } return v; }
/** * @param method Distribution method * @return Origin server hostname. This is not the same as the container for * custom origin configurations and website endpoints. <bucketname>.s3.amazonaws.com */ protected URI getOrigin(final Path container, final Distribution.Method method) { return URI.create(String.format("http://%s.%s", container.getName(), bookmark.getProtocol().getDefaultHostname())); }
/** * @return Null if no container component in hostname prepended */ protected String getContainer(final Host host) { if(StringUtils.isBlank(host.getProtocol().getDefaultHostname())) { return null; } final String hostname = host.getHostname(); if(hostname.equals(host.getProtocol().getDefaultHostname())) { return null; } if(hostname.endsWith(host.getProtocol().getDefaultHostname())) { return ServiceUtils.findBucketNameInHostname(hostname, host.getProtocol().getDefaultHostname()); } return null; } }
@Override public String getHostname() { return session.getHost().getProtocol().getDefaultHostname(); } }
@Override public String getHostname() { return session.getHost().getProtocol().getDefaultHostname(); }
case azure: case onedrive: if(StringUtils.isNotBlank(protocol.getDefaultHostname())) { if(StringUtils.isNotBlank(hostname)) { path = PathNormalizer.normalize(hostname) + path; hostname = protocol.getDefaultHostname(); if(StringUtils.isNotBlank(protocol.getDefaultHostname())) { hostname = protocol.getDefaultHostname();
public static String toString(final Host bookmark, final boolean username) { if(StringUtils.isEmpty(bookmark.getNickname())) { if(StringUtils.isNotBlank(bookmark.getProtocol().getDefaultNickname())) { return bookmark.getProtocol().getDefaultNickname(); } final String prefix; // Return default bookmark name if(username && !bookmark.getCredentials().isAnonymousLogin() && StringUtils.isNotBlank(bookmark.getCredentials().getUsername())) { prefix = String.format("%s@", bookmark.getCredentials().getUsername()); } else { prefix = StringUtils.EMPTY; } if(StringUtils.isNotBlank(bookmark.getHostname())) { return String.format("%s%s \u2013 %s", prefix, StringUtils.strip(bookmark.getHostname()), bookmark.getProtocol().getName()); } if(StringUtils.isNotBlank(bookmark.getProtocol().getDefaultHostname())) { return String.format("%s%s \u2013 %s", prefix, StringUtils.strip(bookmark.getProtocol().getDefaultHostname()), bookmark.getProtocol().getName()); } return String.format("%s%s", prefix, bookmark.getProtocol().getName()); } // Return custom bookmark name set return bookmark.getNickname(); } }
@Override public void change(final Host bookmark) { updateField(hostField, bookmark.getHostname()); hostField.setEnabled(bookmark.getProtocol().isHostnameConfigurable()); hostField.cell().setPlaceholderString(bookmark.getProtocol().getDefaultHostname()); } });
bookmark.setHostname(selected.getDefaultHostname()); bookmark.setHostname(selected.getDefaultHostname()); if(StringUtils.isNotBlank(selected.getDefaultHostname())) { bookmark.setHostname(selected.getDefaultHostname());
private String getHostnameForContainer(final Path bucket) { if(!ServiceUtils.isBucketNameValidDNSName(containerService.getContainer(bucket).getName())) { return session.getHost().getHostname(); } if(session.getHost().getHostname().equals(session.getHost().getProtocol().getDefaultHostname())) { return String.format("%s.%s", bucket.getName(), session.getHost().getHostname()); } return session.getHost().getHostname(); } }
@Override public boolean equals(Object o) { if(this == o) { return true; } if(!(o instanceof Protocol)) { return false; } Protocol protocol = (Protocol) o; if(this.getIdentifier() != null ? !this.getIdentifier().equals(protocol.getIdentifier()) : protocol.getIdentifier() != null) { return false; } if(this.getScheme() != null ? !this.getScheme().equals(protocol.getScheme()) : protocol.getScheme() != null) { return false; } if(this.getContext() != null ? !this.getContext().equals(protocol.getContext()) : protocol.getContext() != null) { return false; } if(this.getAuthorization() != null ? !this.getAuthorization().equals(protocol.getAuthorization()) : protocol.getAuthorization() != null) { return false; } if(this.getProvider() != null ? !this.getProvider().equals(protocol.getProvider()) : protocol.getProvider() != null) { return false; } if(this.getDefaultHostname() != null ? !this.getDefaultHostname().equals(protocol.getDefaultHostname()) : protocol.getDefaultHostname() != null) { return false; } return true; }
if(bookmark.getProtocol().getDefaultHostname().endsWith("identity.api.rackspacecloud.com") || bookmark.getHostname().endsWith("identity.api.rackspacecloud.com")) { return Collections.singleton(new Authentication20RAXUsernameKeyRequest(
final Host host = new Host(profile, profile.getDefaultHostname(), profile.getDefaultPort()); newDocument().addBookmark(host);
session.getFeature(AnalyticsProvider.class).getSetup(session.getHost().getProtocol().getDefaultHostname(), session.getHost().getProtocol().getScheme(), file, credentials) ));