📄 e418. importing preferences.txt
字号:
Preferences can be exported using Preferences.exportNode() (see e419 Exporting the Preferences in a Preference Node) and Preferences.exportSubtree() (see e420 Exporting the Preferences in a Subtree of Preference Nodes). This exported data can be imported using Preferences.importPreferences().
Each preference in exported data contains the path of the node that held the preference. When the exported preference is later imported, it is added to the node with the same path.
This example demonstrates how to import a file of exported preference data.
// Create an input stream on a file
InputStream is = null;
try {
is = new BufferedInputStream(new FileInputStream("output.xml"));
} catch (FileNotFoundException e) {
}
// Import preference data
try {
Preferences.importPreferences(is);
} catch (InvalidPreferencesFormatException e) {
} catch (IOException e) {
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -