mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-1511: Automatically trim whitespace from property values.
This commit is contained in:
@@ -29,7 +29,8 @@ import org.apache.guacamole.GuacamoleServerException;
|
||||
|
||||
/**
|
||||
* GuacamoleProperties implementation which reads all properties from a
|
||||
* standard Java properties file.
|
||||
* standard Java properties file. Whitespace at the end of property values is
|
||||
* automatically trimmed.
|
||||
*/
|
||||
public class FileGuacamoleProperties extends PropertiesGuacamoleProperties {
|
||||
|
||||
|
@@ -24,7 +24,8 @@ import org.apache.guacamole.GuacamoleException;
|
||||
|
||||
/**
|
||||
* GuacamoleProperties implementation which reads all properties from a
|
||||
* {@link Properties} object.
|
||||
* {@link Properties} object. Whitespace at the end of property values is
|
||||
* automatically trimmed.
|
||||
*/
|
||||
public class PropertiesGuacamoleProperties implements GuacamoleProperties {
|
||||
|
||||
@@ -43,12 +44,19 @@ public class PropertiesGuacamoleProperties implements GuacamoleProperties {
|
||||
* values exposed by this instance of PropertiesGuacamoleProperties.
|
||||
*/
|
||||
public PropertiesGuacamoleProperties(Properties properties) {
|
||||
this.properties = properties;
|
||||
this(properties);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getProperty(String name) throws GuacamoleException {
|
||||
return properties.getProperty(name);
|
||||
|
||||
String value = properties.getProperty(name);
|
||||
if (value == null)
|
||||
return null;
|
||||
|
||||
return value.trim();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user