/**
* Saves the state of the UserSettings to an XML file.
*
* @param xmlFileName
* Path to saved object
* @return if the settings could be saved
*/
public boolean saveXmlEncodedBean(String xmlFileName) {
boolean succeeded = false;
try (XMLEncoder encoder = new XMLEncoder(
new BufferedOutputStream(new FileOutputStream(xmlFileName)))) {
encoder.writeObject(this);
succeeded = true;
} catch (FileNotFoundException e) {
System.err.println("Failed to write file " + xmlFileName + ".");
}
return succeeded;
}
UserSettings.java 文件源码
java
阅读 19
收藏 0
点赞 0
评论 0
项目:sp16-ceg3120
作者:
评论列表
文章目录