Code example for Dictionary

Methods: get

0
	private final String inputVar;
	 
	private final SimpleDateFormat pattern;
	 
	FormatDateStep(Dictionary properties, int index) throws ConfigurationException {
		super(properties, index);
		inputVar = (String) properties.get(index + "_inputvar");
		pattern = new SimpleDateFormat((String) properties.get(index + "_pattern"));
		pattern.setTimeZone(TimeZone.getTimeZone("UTC"));
	} 
 
	@Override 
	public boolean execute(HttpClient client, Map<String, Object> variables) throws IOException {
		final Calendar date = (Calendar) variables.get(inputVar);
		final String formattedDate = pattern.format(date.getTime());
		variables.put(outputVar, formattedDate);
		return true; 
	} 
 
}