本文整理了Java中ch.cyberduck.core.Protocol.getDefaultHostname()
方法的一些代码示例,展示了Protocol.getDefaultHostname()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Protocol.getDefaultHostname()
方法的具体详情如下:
包路径:ch.cyberduck.core.Protocol
类名称:Protocol
方法名:getDefaultHostname
暂无
代码示例来源:origin: iterate-ch/cyberduck
/**
* @param protocol Scheme
*/
public Host(final Protocol protocol) {
this(protocol, protocol.getDefaultHostname());
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public String getDefaultHostname() {
final String v = this.value("Default Hostname");
if(StringUtils.isBlank(v)) {
return parent.getDefaultHostname();
}
return v;
}
代码示例来源:origin: iterate-ch/cyberduck
/**
* @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()));
}
代码示例来源:origin: iterate-ch/cyberduck
/**
* @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;
}
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public String getHostname() {
return session.getHost().getProtocol().getDefaultHostname();
}
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public String getHostname() {
return session.getHost().getProtocol().getDefaultHostname();
}
代码示例来源:origin: iterate-ch/cyberduck
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();
代码示例来源:origin: iterate-ch/cyberduck
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();
}
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public void change(final Host bookmark) {
updateField(hostField, bookmark.getHostname());
hostField.setEnabled(bookmark.getProtocol().isHostnameConfigurable());
hostField.cell().setPlaceholderString(bookmark.getProtocol().getDefaultHostname());
}
});
代码示例来源:origin: iterate-ch/cyberduck
bookmark.setHostname(selected.getDefaultHostname());
bookmark.setHostname(selected.getDefaultHostname());
if(StringUtils.isNotBlank(selected.getDefaultHostname())) {
bookmark.setHostname(selected.getDefaultHostname());
代码示例来源:origin: iterate-ch/cyberduck
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();
}
}
代码示例来源:origin: iterate-ch/cyberduck
@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;
}
代码示例来源:origin: iterate-ch/cyberduck
if(bookmark.getProtocol().getDefaultHostname().endsWith("identity.api.rackspacecloud.com")
|| bookmark.getHostname().endsWith("identity.api.rackspacecloud.com")) {
return Collections.singleton(new Authentication20RAXUsernameKeyRequest(
代码示例来源:origin: iterate-ch/cyberduck
final Host host = new Host(profile, profile.getDefaultHostname(), profile.getDefaultPort());
newDocument().addBookmark(host);
代码示例来源:origin: iterate-ch/cyberduck
session.getFeature(AnalyticsProvider.class).getSetup(session.getHost().getProtocol().getDefaultHostname(),
session.getHost().getProtocol().getScheme(), file, credentials)
));
内容来源于网络,如有侵权,请联系作者删除!