public void setEnabledCipherSuites(String enabledCipherSuites) { this.enabledCipherSuites = StringUtils.splitAndTrim(enabledCipherSuites, ","); }
public void setEnabledProtocols(String enabledProtocols) { this.enabledProtocols = StringUtils.splitAndTrim(enabledProtocols, ","); }
@Test public void testSplitAndTrim2() { String[] inputValues = new String[] {"foo", "bar", "baz", "kaboom"}; String inputString = new StringBuilder(40).append(inputValues[0]).append(" ,").append(", ").append(inputValues[1]) .append(" ,").append(inputValues[2]).append(" , ").append(inputValues[3]).append(" ").toString(); assertTrue(Arrays.equals(inputValues, StringUtils.splitAndTrim(inputString, ","))); }
@Test public void testSplitAndTrim3() { String[] inputValues = new String[] {"foo", "bar", "baz", "kaboom"}; String inputString = "foo, bar,\nbaz, \nkaboom"; assertTrue(Arrays.equals(inputValues, StringUtils.splitAndTrim(inputString, ","))); }
@Test public void testSplitAndTrim1() { String[] result = StringUtils.splitAndTrim(null, ",,"); assertNull(result); result = StringUtils.splitAndTrim("", ","); assertNotNull(result); assertTrue(Arrays.equals(ArrayUtils.EMPTY_STRING_ARRAY, result)); result = StringUtils.splitAndTrim(" ", ","); assertNotNull(result); assertTrue(Arrays.equals(ArrayUtils.EMPTY_STRING_ARRAY, result)); }
public void setEnabledCipherSuites(String enabledCipherSuites) { this.enabledCipherSuites = StringUtils.splitAndTrim(enabledCipherSuites, ","); }
public void setEnabledProtocols(String enabledProtocols) { this.enabledProtocols = StringUtils.splitAndTrim(enabledProtocols, ","); }
/** * @param artifactConfigResources a comma separated list of configuration files to load, this should be accessible on the * classpath or filesystem * @param artifactProperties map of properties that can be referenced from the {@code artifactConfigResources} as external * configuration values * @throws org.mule.runtime.core.api.config.ConfigurationException usually if the config resources cannot be loaded */ public AbstractResourceConfigurationBuilder(String artifactConfigResources, Map<String, String> artifactProperties) throws ConfigurationException { this.artifactConfigResources = loadConfigResources(StringUtils.splitAndTrim(artifactConfigResources, ",; ")); this.artifactProperties = artifactProperties; }
public void load(String fileName) { try { InputStream config = IOUtils.getResourceAsStream(fileName, TlsProperties.class); if (config == null) { logger.warn(String.format("File %s not found, using default configuration.", fileName)); } else { logger.info(String.format("Loading configuration file: %s", fileName)); Properties properties = loadProperties(config); String enabledCipherSuitesProperty = properties.getProperty("enabledCipherSuites"); String enabledProtocolsProperty = properties.getProperty("enabledProtocols"); String defaultProtocolProperty = properties.getProperty("defaultProtocol"); if (enabledCipherSuitesProperty != null) { enabledCipherSuites = StringUtils.splitAndTrim(enabledCipherSuitesProperty, ","); } if (enabledProtocolsProperty != null) { enabledProtocols = StringUtils.splitAndTrim(enabledProtocolsProperty, ","); } if (defaultProtocolProperty != null) { defaultProtocol = defaultProtocolProperty.trim(); } } } catch (IOException e) { logger.warn(String.format("Cannot read file %s, using default configuration", fileName), e); } }
@Test public void testSplitAndTrim2() { String[] inputValues = new String[] {"foo", "bar", "baz", "kaboom"}; String inputString = new StringBuilder(40).append(inputValues[0]).append(" ,").append(", ").append(inputValues[1]) .append(" ,").append(inputValues[2]).append(" , ").append(inputValues[3]).append(" ").toString(); assertTrue(Arrays.equals(inputValues, StringUtils.splitAndTrim(inputString, ","))); }
@Test public void testSplitAndTrim3() { String[] inputValues = new String[] {"foo", "bar", "baz", "kaboom"}; String inputString = "foo, bar,\nbaz, \nkaboom"; assertTrue(Arrays.equals(inputValues, StringUtils.splitAndTrim(inputString, ","))); }
@Test public void testSplitAndTrim1() { String[] result = StringUtils.splitAndTrim(null, ",,"); assertNull(result); result = StringUtils.splitAndTrim("", ","); assertNotNull(result); assertTrue(Arrays.equals(ArrayUtils.EMPTY_STRING_ARRAY, result)); result = StringUtils.splitAndTrim(" ", ","); assertNotNull(result); assertTrue(Arrays.equals(ArrayUtils.EMPTY_STRING_ARRAY, result)); }
@Override public final void initialise() throws InitialisationException { if (securityManager == null) { securityManager = (SecurityManager) registry.lookupByName(OBJECT_SECURITY_MANAGER).get(); } if (securityManager == null) { throw new InitialisationException(authSecurityManagerNotSet(), this); } // This filter may only allow authentication on a subset of registered // security providers if (securityProviders != null) { SecurityManager localManager = new DefaultMuleSecurityManager(); String[] securityProviders = splitAndTrim(this.securityProviders, ","); for (String sp : securityProviders) { SecurityProvider provider = securityManager.getProvider(sp); if (provider != null) { localManager.addProvider(provider); } else { throw new InitialisationException(objectNotRegistered("Security Provider", sp), this); } } securityManager = localManager; } doInitialise(); }