提交 526c7880 编写于 作者: K Kohsuke Kawaguchi

fixed the backward compatibility stuff

上级 4e5945c2
......@@ -4,6 +4,7 @@ import hudson.Extension;
import hudson.Util;
import hudson.XmlFile;
import hudson.util.FormValidation;
import hudson.util.XStream2;
import net.sf.json.JSONObject;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.StaplerRequest;
......@@ -29,17 +30,26 @@ public class JenkinsLocationConfiguration extends GlobalConfiguration {
private String adminAddress;
private String jenkinsUrl;
// just to suppress warnings
private transient String charset,useSsl;
public static JenkinsLocationConfiguration get() {
return GlobalConfiguration.all().get(JenkinsLocationConfiguration.class);
}
public JenkinsLocationConfiguration() {
load();
}
@Override
public synchronized void load() {
// for backward compatibility, if we don't have our own data yet, then
// load from Mailer.
XmlFile file = getConfigFile();
if(!file.exists()) {
file = new XmlFile(new File(Jenkins.getInstance().getRootDir(),"hudson.tasks.Mailer.xml"));
XStream2 xs = new XStream2();
xs.addCompatibilityAlias("hudson.tasks.Mailer$DescriptorImpl",JenkinsLocationConfiguration.class);
file = new XmlFile(xs,new File(Jenkins.getInstance().getRootDir(),"hudson.tasks.Mailer.xml"));
if (file.exists()) {
try {
file.unmarshal(this);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册