本文整理了Java中ch.cyberduck.core.Protocol.getProvider()
方法的一些代码示例,展示了Protocol.getProvider()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Protocol.getProvider()
方法的具体详情如下:
包路径:ch.cyberduck.core.Protocol
类名称:Protocol
方法名:getProvider
[英]Provider identification
[中]提供者标识
代码示例来源:origin: iterate-ch/cyberduck
@Override
public String getProvider() {
final String v = this.value("Vendor");
if(StringUtils.isBlank(v)) {
return parent.getProvider();
}
return v;
}
代码示例来源:origin: iterate-ch/cyberduck
/**
* @param enabled List of protocols
* @param identifier Serialized protocol reference or scheme
* @param provider Custom inherited protocol definition
* @return Matching protocol or null if no match
*/
public Protocol forName(final List<Protocol> enabled, final String identifier, final String provider) {
final Protocol match =
// Matching hash code backward compatibility
enabled.stream().filter(protocol -> String.valueOf(protocol.hashCode()).equals(identifier)).findFirst().orElse(
// Matching vendor string for third party profiles
enabled.stream().filter(protocol -> new ProfileProtocolPredicate().test(protocol) && StringUtils.equals(protocol.getProvider(), provider)).findFirst().orElse(
// Matching vendor string usage in CLI
enabled.stream().filter(protocol -> StringUtils.equals(protocol.getProvider(), identifier)).findFirst().orElse(
// Fallback for bug in 6.1
enabled.stream().filter(protocol -> StringUtils.equals(String.format("%s-%s", protocol.getIdentifier(), protocol.getProvider()), identifier)).findFirst().orElse(
// Matching scheme with fallback to generic protocol type
this.forScheme(enabled, identifier, enabled.stream().filter(protocol -> StringUtils.equals(protocol.getType().name(), identifier)).findFirst().orElse(null))
)
)
)
);
if(null == match) {
if(enabled.isEmpty()) {
log.error(String.format("List of registered protocols in %s is empty", this));
}
log.error(String.format("Missing registered protocol for identifier %s", identifier));
}
return match;
}
代码示例来源: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.getProvider() != null ? !this.getProvider().equals(protocol.getProvider()) : protocol.getProvider() != null) {
return false;
}
return true;
}
代码示例来源:origin: iterate-ch/cyberduck
protected static String getScheme(final Protocol protocol) {
if(new BundledProtocolPredicate().test(protocol)) {
for(String scheme :
protocol.getSchemes()) {
// Return first custom scheme registered
return scheme;
}
// Return default name
return protocol.getIdentifier();
}
// Find parent protocol definition for profile
final Protocol standard = ProtocolFactory.get().forName(protocol.getIdentifier());
if(Arrays.equals(protocol.getSchemes(), standard.getSchemes())) {
// No custom scheme set in profile
return protocol.getProvider();
}
for(String scheme : protocol.getSchemes()) {
// First custom scheme in profile
return scheme;
}
// Default vendor string of third party profile
return protocol.getProvider();
}
}
代码示例来源: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
@Override
public <T> T serialize(final Serializer dict) {
dict.setStringForKey(protocol.getIdentifier(), "Protocol");
if(StringUtils.isNotBlank(protocol.getProvider())) {
if(!StringUtils.equals(protocol.getProvider(), protocol.getIdentifier())) {
dict.setStringForKey(protocol.getProvider(), "Provider");
内容来源于网络,如有侵权,请联系作者删除!