public void setNioWorkers(int nioWorkers) { if (nioWorkers > 0) { PropertyResolverUtils.updateProperty(this, NIO_WORKERS, nioWorkers); } else { PropertyResolverUtils.updateProperty(this, NIO_WORKERS, null); } }
default String getStringProperty(String name, String def) { return PropertyResolverUtils.getStringProperty(this, name, def); }
default boolean getBooleanProperty(String name, boolean def) { return PropertyResolverUtils.getBooleanProperty(this, name, def); }
String id = getFileSystemIdentifier(host, port, username); Map<String, Object> params = resolveFileSystemParameters(env, parseURIParameters(uri)); PropertyResolver resolver = PropertyResolverUtils.toPropertyResolver(params); SftpVersionSelector selector = resolveSftpVersionSelector(uri, getSftpVersionSelector(), resolver); Charset decodingCharset = PropertyResolverUtils.getCharset(resolver, NAME_DECORDER_CHARSET_PROP_NAME, DEFAULT_NAME_DECODER_CHARSET); long maxConnectTime = resolver.getLongProperty(CONNECT_TIME_PROP_NAME, DEFAULT_CONNECT_TIME); long maxAuthTime = resolver.getLongProperty(AUTH_TIME_PROP_NAME, DEFAULT_AUTH_TIME); PropertyResolverUtils.updateProperty(session, key, value); PropertyResolverUtils.updateProperty(session, SftpClient.NAME_DECODING_CHARSET, decodingCharset);
Integer maxSessionCount = PropertyResolverUtils.getInteger(session, ServerFactoryManager.MAX_CONCURRENT_SESSIONS); if (maxSessionCount != null) { int currentSessionCount = session.getActiveSessionCountForUser(username); String welcomeBanner = PropertyResolverUtils.getString(session, ServerFactoryManager.WELCOME_BANNER); if (GenericUtils.length(welcomeBanner) > 0) { String lang = PropertyResolverUtils.getStringProperty(session, ServerFactoryManager.WELCOME_BANNER_LANGUAGE, ServerFactoryManager.DEFAULT_WELCOME_BANNER_LANGUAGE);
public static Object resolveBanner(PropertyResolver options) { String bannerOption = PropertyResolverUtils.getString(options, BANNER_CONFIG_PROP); if (GenericUtils.isEmpty(bannerOption)) { bannerOption = PropertyResolverUtils.getStringProperty(options, VISUAL_HOST_KEY, DEFAULT_VISUAL_HOST_KEY); if (ConfigFileReaderSupport.parseBooleanValue(bannerOption)) { bannerOption = ServerAuthenticationManager.AUTO_WELCOME_BANNER_VALUE; } else { bannerOption = null; } } if (GenericUtils.isEmpty(bannerOption)) { return "Welcome to SSHD\n"; } else if ("none".equals(bannerOption)) { return null; } else if (ServerAuthenticationManager.AUTO_WELCOME_BANNER_VALUE.equalsIgnoreCase(bannerOption)) { return bannerOption; } else { return Paths.get(bannerOption); } } }
maxAuthRequests = PropertyResolverUtils.getIntProperty(s, ServerAuthenticationManager.MAX_AUTH_REQUESTS, ServerAuthenticationManager.DEFAULT_MAX_AUTH_REQUESTS); String mths = PropertyResolverUtils.getString(s, ServerFactoryManager.AUTH_METHODS); if (GenericUtils.isEmpty(mths)) { for (NamedFactory<UserAuth> uaf : factories) {
default String getString(String name) { return PropertyResolverUtils.getString(this, name); }
default Object getObject(String name) { return PropertyResolverUtils.getObject(this, name); } }
default int getIntProperty(String name, int def) { return PropertyResolverUtils.getIntProperty(this, name, def); }
Object phase = PropertyResolverUtils.getObject(s, ServerAuthenticationManager.WELCOME_BANNER_PHASE); phase = PropertyResolverUtils.toEnum(WelcomeBannerPhase.class, phase, true, WelcomeBannerPhase.VALUES); welcomePhase = (phase == null) ? ServerAuthenticationManager.DEFAULT_BANNER_PHASE : (WelcomeBannerPhase) phase; maxAuthRequests = s.getIntProperty(ServerAuthenticationManager.MAX_AUTH_REQUESTS, ServerAuthenticationManager.DEFAULT_MAX_AUTH_REQUESTS);
/** * Wraps a {@link Map} into a {@link PropertyResolver} so it can be used * with these utilities * * @param props The properties map - may be {@code null}/empty if no properties * are updated * @return The resolver wrapper */ public static PropertyResolver toPropertyResolver(Map<String, Object> props) { return toPropertyResolver(props, null); }
default long getLongProperty(String name, long def) { return PropertyResolverUtils.getLongProperty(this, name, def); }
Charset cs = PropertyResolverUtils.getCharset(session, ServerAuthenticationManager.WELCOME_BANNER_CHARSET, Charset.defaultCharset()); return loadWelcomeBanner(session, (URL) bannerValue, cs);
default Integer getInteger(String name) { return PropertyResolverUtils.getInteger(this, name); }
Integer maxSessionCount = PropertyResolverUtils.getInteger(session, ServerFactoryManager.MAX_CONCURRENT_SESSIONS); if (maxSessionCount != null) { int currentSessionCount = session.getActiveSessionCountForUser(username); String welcomeBanner = PropertyResolverUtils.getString(session, ServerFactoryManager.WELCOME_BANNER); if (GenericUtils.length(welcomeBanner) > 0) { String lang = PropertyResolverUtils.getStringProperty(session, ServerFactoryManager.WELCOME_BANNER_LANGUAGE, ServerFactoryManager.DEFAULT_WELCOME_BANNER_LANGUAGE);
public static Object resolveBanner(PropertyResolver options) { String bannerOption = PropertyResolverUtils.getString(options, BANNER_CONFIG_PROP); if (GenericUtils.isEmpty(bannerOption)) { bannerOption = PropertyResolverUtils.getStringProperty(options, VISUAL_HOST_KEY, DEFAULT_VISUAL_HOST_KEY); if (ConfigFileReaderSupport.parseBooleanValue(bannerOption)) { bannerOption = ServerAuthenticationManager.AUTO_WELCOME_BANNER_VALUE; } else { bannerOption = null; } } if (GenericUtils.isEmpty(bannerOption)) { return "Welcome to SSHD\n"; } else if ("none".equals(bannerOption)) { return null; } else if (ServerAuthenticationManager.AUTO_WELCOME_BANNER_VALUE.equalsIgnoreCase(bannerOption)) { return bannerOption; } else { return Paths.get(bannerOption); } } }
maxAuthRequests = PropertyResolverUtils.getIntProperty(s, ServerAuthenticationManager.MAX_AUTH_REQUESTS, ServerAuthenticationManager.DEFAULT_MAX_AUTH_REQUESTS); String mths = PropertyResolverUtils.getString(s, ServerFactoryManager.AUTH_METHODS); if (GenericUtils.isEmpty(mths)) { for (NamedFactory<UserAuth> uaf : factories) {