Java Code Examples for org.apache.brooklyn.util.text.Strings#EMPTY

The following examples show how to use org.apache.brooklyn.util.text.Strings#EMPTY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BrooklynPropertiesImpl.java    From brooklyn-server with Apache License 2.0 6 votes vote down vote up
@Override
public BrooklynPropertiesImpl addFrom(InputStream i) {
    // Ugly way to load them in order, but Properties is a Hashtable so loses order otherwise.
    @SuppressWarnings({ "serial" })
    Properties p = new Properties() {
        @Override
        public synchronized Object put(Object key, Object value) {
            // Trim the string values to remove leading and trailing spaces
            String s = (String) value;
            if (Strings.isBlank(s)) {
                s = Strings.EMPTY;
            } else {
                s = CharMatcher.BREAKING_WHITESPACE.trimFrom(s);
            }
            return BrooklynPropertiesImpl.this.put(key, s);
        }
    };
    try {
        p.load(i);
    } catch (IOException e) {
        throw Throwables.propagate(e);
    }
    return this;
}
 
Example 2
Source File: SeaCloudsMonitoringInitializationPolicies.java    From SeaCloudsPlatform with Apache License 2.0 5 votes vote down vote up
private String getMainUri(Entity child) {
    URI mainUri = child.getAttribute(Attributes.MAIN_URI);
    if (mainUri != null) {
        return mainUri.toString();
    }
    return Strings.EMPTY;
}
 
Example 3
Source File: PhpHttpdSshDriver.java    From SeaCloudsPlatform with Apache License 2.0 5 votes vote down vote up
private String getSetEnvVariablesDeclaration() {
    String vaiablesDeclarations = Strings.EMPTY;
    for (Map.Entry<String, String> envEntry : getEntity().getPhpEnvVariables().entrySet()) {
        String envDeclaration =
                getSetEnvVariableConfiguration(envEntry.getKey(), envEntry.getValue()) + "\n";
        vaiablesDeclarations = vaiablesDeclarations.concat(envDeclaration);
    }
    return vaiablesDeclarations;
}