@PostConstruct public void placeholders() { // workaround until we get a tomee version supporting it OOTB for resources achillesLibraries = simpleValue(achillesLibraries); hazelcastLibraries = simpleValue(hazelcastLibraries); if (password != null) { password = simpleValue(password); } } }
public static String value(final String aw) { if (aw == null) { return null; } if (!aw.contains(PREFIX) || !aw.contains(SUFFIX)) { return decryptIfNeeded(aw); } String value = CACHE.getProperty(aw); if (value != null) { return value; } value = simpleValue(aw); CACHE.setProperty(aw, value); return value; }
public static Properties simpleHolds(final Properties properties) { return holds(properties, false); }
private static Properties holds(final Properties properties, final boolean cache) { // we can put null values in SuperProperties, since properties is often of this type we need to tolerate it final Properties updated = new SuperProperties(); if (properties == null) { return updated; } for (final Map.Entry<Object, Object> entry : properties.entrySet()) { final Object rawValue = entry.getValue(); if (rawValue instanceof String) { final String value = (String) rawValue; updated.put(entry.getKey(), cache ? value(value) : simpleValue(value)); } else { updated.put(entry.getKey(), rawValue); } } return updated; }
private static Properties holds(final Properties properties, final boolean cache) { // we can put null values in SuperProperties, since properties is often of this type we need to tolerate it final Properties updated = new SuperProperties(); if (properties == null) { return updated; } for (final Map.Entry<Object, Object> entry : properties.entrySet()) { final Object rawValue = entry.getValue(); if (rawValue instanceof String) { final String value = (String) rawValue; updated.put(entry.getKey(), cache ? value(value) : simpleValueAsStringOrCharArray(value)); } else { updated.put(entry.getKey(), rawValue); } } return updated; }
final Map<ResourceInfo, Resource> resourcesMap = new HashMap<ResourceInfo, Resource>(resources.size()); for (final Resource resource : resources) { final String originalId = PropertyPlaceHolderHelper.value(resource.getId()); final String modulePrefix = module.getModuleId() + "/"; resource.setId(modulePrefix + replaceJavaAndSlash(originalId)); resource.setJndi(PropertyPlaceHolderHelper.value(resource.getJndi())); thread.setContextClassLoader(module.getClassLoader()); try { resource.getProperties().putAll(PropertyPlaceHolderHelper.holds(resource.getProperties())); } finally { thread.setContextClassLoader(oldCl);
private static void put(final Properties properties, final String key, final Object value) { if (key != null && value != null) { properties.put(key, PropertyPlaceHolderHelper.value(String.valueOf(value))); } } }
public static Object simpleValueAsStringOrCharArray(final String raw) { if (raw == null) { return null; } if (!raw.contains(PREFIX) || !raw.contains(SUFFIX)) { return decryptIfNeeded(raw.replace(PREFIX, "").replace(SUFFIX, ""), true); } String value = SUBSTITUTOR.replace(raw); if (!value.equals(raw) && value.startsWith("java:")) { value = value.substring(5); } return decryptIfNeeded(value.replace(PREFIX, "").replace(SUFFIX, ""), true); }
final Properties allProperties = PropertyPlaceHolderHelper.simpleHolds(info.properties); allProperties.remove("SkipPropertiesFallback"); if (services == null) { // small optim for internal resources
holdsWithUpdate(serviceProperties);
final Map<ResourceInfo, Resource> resourcesMap = new HashMap<ResourceInfo, Resource>(resources.size()); for (final Resource resource : resources) { final String originalId = PropertyPlaceHolderHelper.value(resource.getId()); final String modulePrefix = module.getModuleId() + "/"; resource.setId(modulePrefix + replaceJavaAndSlash(originalId)); resource.setJndi(PropertyPlaceHolderHelper.value(resource.getJndi())); resource.getProperties().putAll(PropertyPlaceHolderHelper.holds(resource.getProperties()));
private static void put(final Properties properties, final String key, final Object value) { if (key == null) { return; } if (value == null) { return; } properties.put(key, PropertyPlaceHolderHelper.value(String.valueOf(value))); } }
public static String simpleValue(final String raw) { if (raw == null) { return null; } if (!raw.contains(PREFIX) || !raw.contains(SUFFIX)) { return String.class.cast(decryptIfNeeded(raw.replace(PREFIX, "").replace(SUFFIX, ""), false)); } String value = SUBSTITUTOR.replace(raw); if (!value.equals(raw) && value.startsWith("java:")) { value = value.substring(5); } return String.class.cast(decryptIfNeeded(value.replace(PREFIX, "").replace(SUFFIX, ""), false)); }
final Properties props = PropertyPlaceHolderHelper.simpleHolds(serviceInfo.properties); if (serviceInfo.properties.containsKey("Definition")) { try { // we catch classcast etc..., if it fails it is not important
public void setHeaderName(final String testHeaderName) { this.headerName = simpleValue(testHeaderName.toLowerCase(Locale.ENGLISH)); }
public static String value(final String aw) { if (aw == null) { return null; } if (!aw.contains(PREFIX) || !aw.contains(SUFFIX)) { return String.class.cast(decryptIfNeeded(aw, false)); } String value = CACHE.getProperty(aw); if (value != null) { return value; } value = simpleValue(aw); CACHE.setProperty(aw, value); return value; }
private static void put(final Properties properties, final String key, final Object value) { if (key == null) { return; } if (value == null) { return; } properties.put(key, PropertyPlaceHolderHelper.value(String.valueOf(value))); } }
public static Properties simpleHolds(final Properties properties) { return holds(properties, false); }
public static String simpleValue(final String raw) { if (raw == null) { return null; } if (!raw.contains(PREFIX) || !raw.contains(SUFFIX)) { return decryptIfNeeded(raw.replace(PREFIX, "").replace(SUFFIX, "")); } String value = SUBSTITUTOR.replace(raw); if (!value.equals(raw) && value.startsWith("java:")) { value = value.substring(5); } return decryptIfNeeded(value.replace(PREFIX, "").replace(SUFFIX, "")); }
final Properties props = PropertyPlaceHolderHelper.simpleHolds(serviceInfo.properties); if (serviceInfo.properties.containsKey("Definition")) { final Object encoding = serviceInfo.properties.remove("DefinitionEncoding");