本文整理了Java中ch.cyberduck.core.Protocol.getDefaultPort()
方法的一些代码示例,展示了Protocol.getDefaultPort()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Protocol.getDefaultPort()
方法的具体详情如下:
包路径:ch.cyberduck.core.Protocol
类名称:Protocol
方法名:getDefaultPort
暂无
代码示例来源:origin: iterate-ch/cyberduck
/**
* @param protocol Scheme
* @param hostname The hostname of the server
* @param credentials Login credentials
*/
public Host(final Protocol protocol, final String hostname, final Credentials credentials) {
this(protocol, hostname, protocol.getDefaultPort(), credentials);
}
代码示例来源:origin: iterate-ch/cyberduck
/**
* @param port The port number to connect to or -1 to use the default port for this protocol
*/
public void setPort(final int port) {
this.port = -1 == port ? protocol.getDefaultPort() : port;
}
代码示例来源:origin: iterate-ch/cyberduck
/**
* @param protocol Scheme
* @param hostname The hostname of the server
*/
public Host(final Protocol protocol, final String hostname) {
this(protocol, hostname, protocol.getDefaultPort());
}
代码示例来源:origin: iterate-ch/cyberduck
@Override
public int getDefaultPort() {
final String v = this.value("Default Port");
if(StringUtils.isBlank(v)) {
return parent.getDefaultPort();
}
try {
return Integer.valueOf(v);
}
catch(NumberFormatException e) {
log.warn(String.format("Port %s is not a number", e.getMessage()));
}
return parent.getDefaultPort();
}
代码示例来源:origin: iterate-ch/cyberduck
int port = protocol.getDefaultPort();
代码示例来源:origin: iterate-ch/cyberduck
@Action
public void protocolComboboxClicked(NSPopUpButton sender) {
final Protocol selected = ProtocolFactory.get().forName(sender.selectedItem().representedObject());
preferences.setProperty("connection.protocol.default", selected.getIdentifier());
preferences.setProperty("connection.port.default", selected.getDefaultPort());
}
代码示例来源:origin: iterate-ch/cyberduck
log.debug(String.format("Protocol selection changed to %s", selected));
bookmark.setPort(selected.getDefaultPort());
if(!bookmark.getProtocol().isHostnameConfigurable()) {
代码示例来源:origin: iterate-ch/cyberduck
final Host host = new Host(profile, profile.getDefaultHostname(), profile.getDefaultPort());
newDocument().addBookmark(host);
代码示例来源:origin: iterate-ch/cyberduck
protected void configure(final FTPClient client) throws IOException {
client.setProtocol(host.getProtocol());
client.setSocketFactory(new ProxySocketFactory(host.getProtocol(), new DefaultTrustManagerHostnameCallback(host)));
client.setControlEncoding(host.getEncoding());
final int timeout = preferences.getInteger("connection.timeout.seconds") * 1000;
client.setConnectTimeout(timeout);
client.setDefaultTimeout(timeout);
client.setDataTimeout(timeout);
client.setDefaultPort(host.getProtocol().getDefaultPort());
client.setParserFactory(new FTPParserFactory());
client.setRemoteVerificationEnabled(preferences.getBoolean("ftp.datachannel.verify"));
final int buffer = preferences.getInteger("ftp.socket.buffer");
client.setBufferSize(buffer);
if(preferences.getInteger("connection.buffer.receive") > 0) {
client.setReceiveBufferSize(preferences.getInteger("connection.buffer.receive"));
}
if(preferences.getInteger("connection.buffer.send") > 0) {
client.setSendBufferSize(preferences.getInteger("connection.buffer.send"));
}
if(preferences.getInteger("connection.buffer.receive") > 0) {
client.setReceieveDataSocketBufferSize(preferences.getInteger("connection.buffer.receive"));
}
if(preferences.getInteger("connection.buffer.send") > 0) {
client.setSendDataSocketBufferSize(preferences.getInteger("connection.buffer.send"));
}
client.setStrictMultilineParsing(preferences.getBoolean("ftp.parser.multiline.strict"));
client.setStrictReplyParsing(preferences.getBoolean("ftp.parser.reply.strict"));
}
内容来源于网络,如有侵权,请联系作者删除!