private File createJavaBeanDumpFile(Object obj) throws IOException, XMLException {
    File tempFile = File.createTempFile(PREFIX, SUFFIX);
    XMLBeanWriter wtr = new XMLBeanWriter(obj);
    wtr.save(tempFile);

    return tempFile;
  }
Exemple #2
0
 /** Save preferences to disk. */
 private void savePrefs() {
   try {
     final XMLBeanWriter wtr = new XMLBeanWriter(_newSessionPrefs);
     wtr.save(fileWrapperFactory.create(_userSettingsFolder, IConstants.USER_PREFS_FILE_NAME));
   } catch (Exception ex) {
     final String msg =
         "Error occured writing to preferences file: " + IConstants.USER_PREFS_FILE_NAME;
     s_log.error(msg, ex);
   }
 }
 /** Save preferences to disk. */
 public void savePrefs() {
   if (!_initialized) {
     throw new IllegalStateException("initialize() must be called first");
   }
   try {
     XMLBeanWriter wtr = new XMLBeanWriter(_prefs);
     wtr.save(fileWrapperFactory.create(_userSettingsFolder, USER_PREFS_FILE_NAME));
   } catch (Exception ex) {
     s_log.error("Error occurred writing to preferences file: " + USER_PREFS_FILE_NAME, ex);
   }
 }