public SshProvider getProvider(SshConfiguration configuration) { /* * First check if the provider system property is set. If it is, we use * that and only that */ SshProvider provider = loadFromProperties(System.getProperties()); if (provider != null && !provider.supportsConfiguration(null)) { throw new UnsupportedOperationException( "The provider " + provider.getClass().getName() + " requires configuration. Use createClient(SshConfiguration) instead or use a different provider."); } /* * Now look for sshapi-providers.properties resources on the classpath */ if (provider == null) { ClassLoader cl = getClassLoader(); try { SshConfiguration.getLogger().log(Level.INFO, "Looking for sshapi-providers.properties resources."); for (Enumeration e = cl .getResources("sshapi-providers.properties"); e .hasMoreElements() && provider == null;) { SshProvider possibleProvider = loadFromProperties((URL) e .nextElement()); if (possibleProvider != null) { if (possibleProvider .supportsConfiguration(configuration)) { SshConfiguration.getLogger().log(Level.INFO, "Provider supports configuration.");
public SshProvider getProvider(SshConfiguration configuration) { /* * First check if the provider system property is set. If it is, we use * that and only that */ SshProvider provider = loadFromProperties(System.getProperties()); if (provider != null && !provider.supportsConfiguration(null)) { throw new UnsupportedOperationException( "The provider " + provider.getClass().getName() + " requires configuration. Use createClient(SshConfiguration) instead or use a different provider."); } /* * Now look for sshapi-providers.properties resources on the classpath */ if (provider == null) { ClassLoader cl = getClassLoader(); try { SshConfiguration.getLogger().log(Level.INFO, "Looking for sshapi-providers.properties resources."); for (Enumeration e = cl .getResources("sshapi-providers.properties"); e .hasMoreElements() && provider == null;) { SshProvider possibleProvider = loadFromProperties((URL) e .nextElement()); if (possibleProvider != null) { if (possibleProvider .supportsConfiguration(configuration)) { SshConfiguration.getLogger().log(Level.INFO, "Provider supports configuration.");