Processes the include directive to insert the contents of another file.
(SSIMediator ssiMediator, String commandName, String[] paramNames, String[] paramValues,
PrintWriter writer)
| 38 | * Processes the include directive to insert the contents of another file. |
| 39 | */ |
| 40 | @Override |
| 41 | public long process(SSIMediator ssiMediator, String commandName, String[] paramNames, String[] paramValues, |
| 42 | PrintWriter writer) { |
| 43 | long lastModified = 0; |
| 44 | String configErrMsg = ssiMediator.getConfigErrMsg(); |
| 45 | for (int i = 0; i < paramNames.length; i++) { |
| 46 | String paramName = paramNames[i]; |
| 47 | String paramValue = paramValues[i]; |
| 48 | String substitutedValue = ssiMediator.substituteVariables(paramValue); |
| 49 | try { |
| 50 | if (paramName.equalsIgnoreCase("file") || paramName.equalsIgnoreCase("virtual")) { |
| 51 | boolean virtual = paramName.equalsIgnoreCase("virtual"); |
| 52 | lastModified = ssiMediator.getFileLastModified(substitutedValue, virtual); |
| 53 | String text = ssiMediator.getFileText(substitutedValue, virtual); |
| 54 | writer.write(text); |
| 55 | } else { |
| 56 | ssiMediator.log(sm.getString("ssiCommand.invalidAttribute", paramName)); |
| 57 | writer.write(configErrMsg); |
| 58 | } |
| 59 | } catch (IOException ioe) { |
| 60 | ssiMediator.log(sm.getString("ssiInclude.includeFailed", substitutedValue), ioe); |
| 61 | writer.write(configErrMsg); |
| 62 | } |
| 63 | } |
| 64 | return lastModified; |
| 65 | } |
| 66 | } |
nothing calls this directly
no test coverage detected