new InputStreamReader(new StreamGobbler(exec.getInputStream()), Charset.forName(session.getHost().getEncoding()))); final BufferedReader stderrReader = new BufferedReader( new InputStreamReader(new StreamGobbler(exec.getErrorStream()), Charset.forName(session.getHost().getEncoding())));
@Override public void change(final Host bookmark) { encodingPopup.setEnabled(bookmark.getProtocol().isEncodingConfigurable()); if(!bookmark.getProtocol().isEncodingConfigurable()) { encodingPopup.selectItemWithTitle(DEFAULT); } else { if(null == bookmark.getEncoding()) { encodingPopup.selectItemWithTitle(DEFAULT); } else { encodingPopup.selectItemAtIndex(encodingPopup.indexOfItemWithRepresentedObject(bookmark.getEncoding())); } } } });
@Action public void encodingMenuClicked(final NSMenuItem sender) { final String encoding = sender.representedObject(); if(null == encoding) { return; } if(this.isMounted()) { if(pool.getHost().getEncoding().equals(encoding)) { return; } pool.getHost().setEncoding(encoding); this.mount(pool.getHost()); } }
protected IRODSFileSystem configure(final IRODSFileSystem client) { final SettableJargonProperties properties = new SettableJargonProperties(client.getJargonProperties()); properties.setEncoding(host.getEncoding()); final int timeout = preferences.getInteger("connection.timeout.seconds") * 1000; properties.setIrodsSocketTimeout(timeout); properties.setIrodsParallelSocketTimeout(timeout); properties.setGetBufferSize(PreferencesFactory.get().getInteger("connection.chunksize")); properties.setPutBufferSize(PreferencesFactory.get().getInteger("connection.chunksize")); if(log.isDebugEnabled()) { log.debug(String.format("Configure client %s with properties %s", client, properties)); } client.getIrodsSession().setJargonProperties(properties); client.getIrodsSession().setX509TrustManager(trust); return client; }
if("UTF-8".equals(host.getEncoding())) { if(client.hasFeature("UTF8")) { if(!FTPReply.isPositiveCompletion(client.sendCommand("OPTS UTF8 ON"))) {
configuration.setDefaultConnectionConfig(ConnectionConfig.custom() .setBufferSize(preferences.getInteger("http.socket.buffer")) .setCharset(Charset.forName(host.getEncoding())) .build()); if(preferences.getBoolean("http.connections.reuse")) {
item.setState(pool.getHost().getEncoding().equalsIgnoreCase( item.title()) ? NSCell.NSOnState : NSCell.NSOffState);
connection.setRemoteCharset(Charset.forName(host.getEncoding())); disconnectListener = new StateDisconnectListener(); final Transport transport = connection.getTransport();
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")); }
final NSPopUpButton popup = Rococoa.cast(item.view(), NSPopUpButton.class); popup.selectItemAtIndex(popup.indexOfItemWithRepresentedObject(controller.isMounted() ? controller.getSession().getHost().getEncoding() : PreferencesFactory.get().getProperty("browser.charset.encoding")));