本文整理了Java中ch.cyberduck.core.Protocol.getType()
方法的一些代码示例,展示了Protocol.getType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Protocol.getType()
方法的具体详情如下:
包路径:ch.cyberduck.core.Protocol
类名称:Protocol
方法名:getType
暂无
代码示例来源:origin: iterate-ch/cyberduck
@Override
public Type getType() {
return parent.getType();
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public boolean test(final Protocol protocol) {
if(types.contains(protocol.getType())) {
return super.test(protocol);
}
return false;
}
}
代码示例来源:origin: iterate-ch/cyberduck
private Protocol forType(final List<Protocol> enabled, final Protocol.Type type) {
return enabled.stream().filter(protocol -> protocol.getType().equals(type)).findFirst().orElse(null);
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public boolean isSupported(final Path source, final Path target) {
switch(from.getHost().getProtocol().getType()) {
case ftp:
case irods:
// Stateful
return !Objects.equals(from, to);
}
return true;
}
代码示例来源: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
private static void append(final Protocol protocol, final StringBuilder builder) {
final String url;
switch(protocol.getType()) {
case b2:
case s3:
case googlestorage:
case swift:
case azure:
url = String.format("%s://<container>/<key>", getScheme(protocol));
break;
default:
if(protocol.isHostnameConfigurable()) {
url = String.format("%s://<hostname>/<folder>/<file>", getScheme(protocol));
}
else {
// case file:
// case googledrive:
// case dropbox:
// case onedrive:
url = String.format("%s://<folder>/<file>", getScheme(protocol));
}
break;
}
builder
.append(String.format("%s %s", StringUtils.leftPad(protocol.getDescription(), 50), url))
.append(StringUtils.LF);
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public void change(Host bookmark) {
connectmodePopup.setEnabled(bookmark.getProtocol().getType() == Protocol.Type.ftp);
if(bookmark.getProtocol().getType() == Protocol.Type.ftp) {
connectmodePopup.selectItemAtIndex(connectmodePopup.indexOfItemWithRepresentedObject(bookmark.getFTPConnectMode().name()));
}
}
});
代码示例来源:origin: iterate-ch/cyberduck
switch(protocol.getType()) {
代码示例来源:origin: iterate-ch/cyberduck
switch(host.getProtocol().getType()) {
case file:
case b2:
代码示例来源:origin: iterate-ch/cyberduck
return false;
return session.getHost().getProtocol().getType() == Protocol.Type.s3
|| session.getHost().getProtocol().getType() == Protocol.Type.b2
|| session.getHost().getProtocol().getType() == Protocol.Type.azure
|| session.getHost().getProtocol().getType() == Protocol.Type.googlestorage;
case metadata:
if(anonymous) {
代码示例来源:origin: iterate-ch/cyberduck
if(!skip && protocol != null && StringUtils.isNotBlank(user)) {
if(ssl) {
switch(protocol.getType()) {
case ftp:
protocol = protocols.forScheme(Scheme.ftps);
代码示例来源:origin: iterate-ch/cyberduck
if(file.isFile() || file.isSymbolicLink()) {
final Path copy = new Path(file);
switch(host.getProtocol().getType()) {
case s3:
if(!file.attributes().isDuplicate()) {
代码示例来源:origin: iterate-ch/cyberduck
dict.setObjectForKey(credentials.getIdentity(), "Private Key File Dictionary");
if(protocol.getType() == Protocol.Type.ftp) {
if(connectMode != FTPConnectMode.unknown) {
dict.setStringForKey(connectMode.name(), "FTP Connect Mode");
代码示例来源:origin: iterate-ch/cyberduck
this.window().endEditingFor(null);
final Credentials credentials = session.getHost().getCredentials();
boolean enable = session.getHost().getProtocol().getType() == Protocol.Type.s3
|| session.getHost().getProtocol().getType() == Protocol.Type.b2
|| session.getHost().getProtocol().getType() == Protocol.Type.azure
|| session.getHost().getProtocol().getType() == Protocol.Type.googlestorage;
if(enable) {
enable = !credentials.isAnonymousLogin();
代码示例来源:origin: iterate-ch/cyberduck
&& controller.getSession().getHost().getProtocol().getType() == Protocol.Type.sftp
&& TerminalServiceFactory.get() != null;
内容来源于网络,如有侵权,请联系作者删除!