Properties are appended when loading plugins (#29)
This commit is contained in:
parent
3535626ad9
commit
901eff682f
@ -2,6 +2,7 @@ package org.owasp.webgoat.plugins;
|
|||||||
|
|
||||||
import com.google.common.base.Preconditions;
|
import com.google.common.base.Preconditions;
|
||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
import org.apache.commons.io.FileUtils;
|
||||||
import org.owasp.webgoat.classloader.PluginClassLoader;
|
import org.owasp.webgoat.classloader.PluginClassLoader;
|
||||||
import org.owasp.webgoat.util.LabelProvider;
|
import org.owasp.webgoat.util.LabelProvider;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@ -62,6 +63,7 @@ public class PluginsLoader implements Runnable {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
PluginFileUtils.createDirsIfNotExists(pluginTarget);
|
PluginFileUtils.createDirsIfNotExists(pluginTarget);
|
||||||
|
cleanupExtractedPluginsDirectory();
|
||||||
List<URL> jars = listJars();
|
List<URL> jars = listJars();
|
||||||
cl.addURL(jars);
|
cl.addURL(jars);
|
||||||
plugins = processPlugins(jars, reload);
|
plugins = processPlugins(jars, reload);
|
||||||
@ -71,6 +73,11 @@ public class PluginsLoader implements Runnable {
|
|||||||
return plugins;
|
return plugins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void cleanupExtractedPluginsDirectory() {
|
||||||
|
Path i18nDirectory = pluginTarget.resolve("plugin/i18n/");
|
||||||
|
FileUtils.deleteQuietly(i18nDirectory.toFile());
|
||||||
|
}
|
||||||
|
|
||||||
private List<URL> listJars() throws IOException {
|
private List<URL> listJars() throws IOException {
|
||||||
final List<URL> jars = Lists.newArrayList();
|
final List<URL> jars = Lists.newArrayList();
|
||||||
Files.walkFileTree(pluginSource, new SimpleFileVisitor<Path>() {
|
Files.walkFileTree(pluginSource, new SimpleFileVisitor<Path>() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user