Processes the config directive to set errmsg, sizefmt, and timefmt options.
(SSIMediator ssiMediator, String commandName, String[] paramNames, String[] paramValues,
PrintWriter writer)
| 36 | * Processes the config directive to set errmsg, sizefmt, and timefmt options. |
| 37 | */ |
| 38 | @Override |
| 39 | public long process(SSIMediator ssiMediator, String commandName, String[] paramNames, String[] paramValues, |
| 40 | PrintWriter writer) { |
| 41 | for (int i = 0; i < paramNames.length; i++) { |
| 42 | String paramName = paramNames[i]; |
| 43 | String paramValue = paramValues[i]; |
| 44 | String substitutedValue = ssiMediator.substituteVariables(paramValue); |
| 45 | if (paramName.equalsIgnoreCase("errmsg")) { |
| 46 | ssiMediator.setConfigErrMsg(substitutedValue); |
| 47 | } else if (paramName.equalsIgnoreCase("sizefmt")) { |
| 48 | ssiMediator.setConfigSizeFmt(substitutedValue); |
| 49 | } else if (paramName.equalsIgnoreCase("timefmt")) { |
| 50 | ssiMediator.setConfigTimeFmt(substitutedValue); |
| 51 | } else { |
| 52 | ssiMediator.log(sm.getString("ssiCommand.invalidAttribute", paramName)); |
| 53 | // We need to fetch this value each time, since it may change during the loop |
| 54 | String configErrMsg = ssiMediator.getConfigErrMsg(); |
| 55 | writer.write(configErrMsg); |
| 56 | } |
| 57 | } |
| 58 | // Setting config options doesn't really change the page |
| 59 | return 0; |
| 60 | } |
| 61 | } |
nothing calls this directly
no test coverage detected