protected static final SshProvider loadFromProperties(URL resource) throws IOException { SshConfiguration.getLogger().log(Level.INFO, "Loading " + resource + "."); return loadFromProperties(loadProperties(resource)); }
/** * Utility to create a client that may be used with this configuration. It * uses the DefaultProviderFactory, so if you want to custom how providers * are selected, do not use this method. * * @return client */ public SshClient createClient() { // Create the client using that configuration SshProvider provider = DefaultProviderFactory.getInstance().getProvider(this); return provider.createClient(this); }
public final void close() throws SshException { if (!isOpen()) { throw new SshException(SshException.NOT_OPEN, "Channel not open."); } fireClosing(); onClose(); open = false; fireClosed(); }
/** * Entry point. * * @param arg command line arguments * @throws Exception */ public static void main(String[] arg) throws Exception { SshConfiguration config = new SshConfiguration(); config.setProtocolVersion(SshConfiguration.SSH1_ONLY); // Create the client using that configuration SshProvider provider = DefaultProviderFactory.getInstance().getProvider(config); SshClient client = provider.createClient(config); ExampleUtilities.dumpClientInfo(client); } }
public final void open() throws SshException { if (isOpen()) { throw new SshException(SshException.ALREADY_OPEN, "Channel already open."); } onOpen(); open = true; fireOpened(); }
public final SshClient createClient(SshConfiguration configuration) { doSupportsConfiguration(configuration); checkDefaultConfiguration(configuration); SshClient client = doCreateClient(configuration); client.init(this); return client; }
public void showMessage(String message) { if (getConfiguration().getBannerHandler() != null) { getConfiguration().getBannerHandler().banner(message); } }
/** * Apply the discovered details to the configuration. * * @param configuration configuration */ public void configure(SshConfiguration configuration) { configuration.setX11Host(x11Host); configuration.setX11Port(x11Port); configuration.setX11Cookie(x11Cookie); }
public boolean isEnabled(int level) { net.sf.sshapi.Logger logger = SshConfiguration.getLogger(); switch (level) { case Logger.DEBUG: return logger.isLevelEnabled(net.sf.sshapi.Logger.Level.DEBUG); case Logger.ERROR: return logger.isLevelEnabled(net.sf.sshapi.Logger.Level.ERROR); case Logger.INFO: return logger.isLevelEnabled(net.sf.sshapi.Logger.Level.INFO); case Logger.WARN: return logger.isLevelEnabled(net.sf.sshapi.Logger.Level.WARN); default: return logger.isLevelEnabled(net.sf.sshapi.Logger.Level.ERROR); } }
public final boolean supportsConfiguration(SshConfiguration configuration) { try { doSupportsConfiguration(configuration); checkDefaultConfiguration(configuration); return true; } catch (UnsupportedOperationException ueo) { return false; } }
public final synchronized void close() throws IOException { try { doClose(); } finally { closed = true; } }
protected static final SshProvider loadFromProperties(URL resource) throws IOException { SshConfiguration.getLogger().log(Level.INFO, "Loading " + resource + "."); return loadFromProperties(loadProperties(resource)); }
public final void close() throws SshException { if (!isOpen()) { throw new SshException(SshException.NOT_OPEN, "Channel not open."); } fireClosing(); onClose(); open = false; fireClosed(); }
/** * Utility to create a client that may be used with this configuration. It * uses the DefaultProviderFactory, so if you want to custom how providers * are selected, do not use this method. * * @return client */ public SshClient createClient() { // Create the client using that configuration SshProvider provider = DefaultProviderFactory.getInstance().getProvider(this); return provider.createClient(this); }
public final void open() throws SshException { if (isOpen()) { throw new SshException(SshException.ALREADY_OPEN, "Channel already open."); } onOpen(); open = true; fireOpened(); }
public final SshClient createClient(SshConfiguration configuration) { doSupportsConfiguration(configuration); checkDefaultConfiguration(configuration); SshClient client = doCreateClient(configuration); client.init(this); return client; }
/** * Apply the discovered details to the configuration. * * @param configuration configuration */ public void configure(SshConfiguration configuration) { configuration.setX11Host(x11Host); configuration.setX11Port(x11Port); configuration.setX11Cookie(x11Cookie); }
public final boolean supportsConfiguration(SshConfiguration configuration) { try { doSupportsConfiguration(configuration); checkDefaultConfiguration(configuration); return true; } catch (UnsupportedOperationException ueo) { return false; } }
public final synchronized void close() throws IOException { try { doClose(); } finally { closed = true; } }