MCPcopy Create free account
hub / github.com/apache/tomcat / process

Method process

java/org/apache/catalina/ssi/SSIInclude.java:40–65  ·  view source on GitHub ↗

Processes the include directive to insert the contents of another file.

(SSIMediator ssiMediator, String commandName, String[] paramNames, String[] paramValues,
            PrintWriter writer)

Source from the content-addressed store, hash-verified

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}

Callers

nothing calls this directly

Calls 8

getConfigErrMsgMethod · 0.80
substituteVariablesMethod · 0.80
getFileLastModifiedMethod · 0.65
getFileTextMethod · 0.65
writeMethod · 0.65
logMethod · 0.65
getStringMethod · 0.65
equalsIgnoreCaseMethod · 0.45

Tested by

no test coverage detected