[JENKINS-32765] Perhaps it makes more sense to make this a property of the PluginManager rather than the classic strategy

- Also expose via servlet context parameter of same name to allow multiple instances of Jenkins in the same servlet container to have different directories
- As we are no longer a constant, change the system property to camelCase
This commit is contained in:
Stephen Connolly committed 2016-02-04 14:40:44 +00:00
1 parent d27cff8fd2
commit c0cbff7297
2 files changed
+21 -10

No files matched your search

@@ -88,12 +88,6 @@ public class ClassicPluginStrategy implements PluginStrategy {
}
};
/**
* If set this should be the absolute file path to the the base directory for all exploded .hpi/.jpi plugins.
* If {@literal null} then plugins will be exploded into {@literal JENKINS_HOME/plugins}.
*/
private static final String WORK_DIR = System.getProperty(ClassicPluginStrategy.class.getName() + ".WORK_DIR");
private PluginManager pluginManager;
/**
@@ -168,10 +162,8 @@ public class ClassicPluginStrategy implements PluginStrategy {
if (archive.isDirectory()) {// already expanded
expandDir = archive;
} else {
expandDir = WORK_DIR == null
? new File(archive.getParentFile(), getBaseName(archive.getName()))
: new File(WORK_DIR, getBaseName(archive.getName()));
;
File f = pluginManager.getWorkDir();
expandDir = new File(f == null ? archive.getParentFile() : f, getBaseName(archive.getName()));
explode(archive, expandDir);
}