From 5dfd1c44e90783ed55743d8264c2ae51478bb86a Mon Sep 17 00:00:00 2001 From: Nanne Baars Date: Thu, 3 Dec 2015 22:52:11 +0100 Subject: [PATCH] Moving lesson utilities to common project instead of AbstractLesson --- .../owasp/webgoat/lessons/AbstractLesson.java | 53 +------------------ 1 file changed, 1 insertion(+), 52 deletions(-) diff --git a/webgoat-container/src/main/java/org/owasp/webgoat/lessons/AbstractLesson.java b/webgoat-container/src/main/java/org/owasp/webgoat/lessons/AbstractLesson.java index 4effc1d76..391edbeab 100644 --- a/webgoat-container/src/main/java/org/owasp/webgoat/lessons/AbstractLesson.java +++ b/webgoat-container/src/main/java/org/owasp/webgoat/lessons/AbstractLesson.java @@ -21,7 +21,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.BufferedReader; -import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.InputStreamReader; @@ -399,7 +398,7 @@ public abstract class AbstractLesson extends Screen implements Comparable - * A reference in include directives are made from within the web application on the server. - * However, img tags (and the like) make references from the client browser. - * In such external references, the context path must be included. - * - * @param w a {@link org.owasp.webgoat.session.WebSession} object. - * @param imgResourceName a {@link java.lang.String} object. - * @return a {@link java.lang.String} object. - */ - protected final String buildImagePath(WebSession w, String imgResourceName) { - return w.getRequest() - .getContextPath() + "/plugin_extracted/plugin/" + getLessonName() + "/images/" + imgResourceName; - } - /** - *

buildJspPath.

- * - * @param w a {@link org.owasp.webgoat.session.WebSession} object. - * @param jspResourceName a {@link java.lang.String} object. - * @param includeContextPath a boolean. - * @return a {@link java.lang.String} object. - */ - protected final String buildJspPath(WebSession w, String jspResourceName, boolean includeContextPath) { - String path = includeContextPath ? w.getContext().getContextPath() : ""; - return path + "/plugin_extracted/plugin/" + getLessonName() + "/jsp/" + jspResourceName; - } - - /** - *

buildJsPath.

- * - * @param w a {@link org.owasp.webgoat.session.WebSession} object. - * @param jsResourceName a {@link java.lang.String} object. - * @return a {@link java.lang.String} object. - */ - protected final String buildJsPath(WebSession w, String jsResourceName) { - return w.getRequest() - .getContextPath() + "/plugin_extracted/plugin/" + getLessonName() + "/js/" + jsResourceName; - } - - /** - *

getLessonDirectory.

- * - * @param w a {@link org.owasp.webgoat.session.WebSession} object. - * @return a {@link java.io.File} object. - */ - protected final File getLessonDirectory(WebSession w) { - return new File(w.getContext().getRealPath("/plugin_extracted/plugin/" + getLessonName() + "/")); - } - }