mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-11 11:06:25 +00:00
modified the Descriptor persistence scheme.
We used to use Map<String,Object> as a data store for Descriptor, but this requires a lot of boiler plate code to move values in/out from this Map, making the code uglier. I modified this to just use XStream like the rest of the Hudson, so that the information can be persisted by simply storing them in fields. Existing Descriptors are enhanced so that they can convert formats from pre-1.62 XML format. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1126 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
329891f83e
commit
6a186623c1
9 files changed
+211
-125
No files matched your search
@@ -51,11 +51,15 @@ public final class XmlFile {
|
||||
|
||||
/**
|
||||
* Loads the contents of this file into an existing object.
|
||||
*
|
||||
* @return
|
||||
* The unmarshalled object. Usually the same as <tt>o</tt>, but would be different
|
||||
* if the XML representation if completely new.
|
||||
*/
|
||||
public void unmarshal( Object o ) throws IOException {
|
||||
public Object unmarshal( Object o ) throws IOException {
|
||||
Reader r = new BufferedReader(new InputStreamReader(new FileInputStream(file),"UTF-8"));
|
||||
try {
|
||||
xs.unmarshal(new XppReader(r),o);
|
||||
return xs.unmarshal(new XppReader(r),o);
|
||||
} catch (StreamException e) {
|
||||
throw new IOException2(e);
|
||||
} catch(ConversionException e) {
|
||||
|
||||
Reference in new issue
Block a user