/** load bot properties */ void addProperties() { try { properties.getProperties(config_path + "/properties.txt"); } catch (Exception ex) { ex.printStackTrace(); } }
@Override public Map<String, String> unmarshal(Properties properties) throws Exception { Map<String, String> map = new HashMap<String, String>(); for (Property property : properties.getProperties()) { map.put(property.getName(), property.getValue()); } return map; }
private static Properties buildProperties( final List<ConstraintDefinition> constraintDefinitions, final Properties inputProperties) { final PropertiesBuilder propertiesBuilder = new PropertiesBuilder(); for (final Property property : inputProperties.getProperties()) { propertiesBuilder.addValue(property, inputProperties.getValue(property)); } // On récupère les propriétés d'après les contraintes for (final ConstraintDefinition constraintDefinition : constraintDefinitions) { propertiesBuilder.addValue( constraintDefinition.getProperty(), constraintDefinition.getPropertyValue()); } return propertiesBuilder.build(); }