Révision 1879
| tmp/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java (revision 1879) | ||
|---|---|---|
| 1082 | 1082 |
*/ |
| 1083 | 1083 |
public static boolean keyExists(String nodePath, String key) {
|
| 1084 | 1084 |
|
| 1085 |
if (!nodePath.startsWith("/instance")) {
|
|
| 1086 |
nodePath = "/instance/" + nodePath; |
|
| 1087 |
} |
|
| 1085 |
// if (!nodePath.startsWith("/instance")) {
|
|
| 1086 |
// nodePath = "/instance/" + nodePath;
|
|
| 1087 |
// }
|
|
| 1088 | 1088 |
|
| 1089 | 1089 |
|
| 1090 |
try {
|
|
| 1091 |
if(preferencesRootNode.nodeExists(nodePath)) {
|
|
| 1092 |
try {
|
|
| 1093 |
return Arrays.asList(preferencesRootNode.node(nodePath).keys()).contains(key); |
|
| 1094 |
} |
|
| 1095 |
catch(BackingStoreException e) {
|
|
| 1096 |
e.printStackTrace(); |
|
| 1097 |
} |
|
| 1090 |
if(preferencesRootNode.node(nodePath) != null) {
|
|
| 1091 |
try {
|
|
| 1092 |
return Arrays.asList(preferencesRootNode.node(nodePath).keys()).contains(key); |
|
| 1098 | 1093 |
} |
| 1094 |
catch(BackingStoreException e) {
|
|
| 1095 |
e.printStackTrace(); |
|
| 1096 |
} |
|
| 1099 | 1097 |
} |
| 1100 |
catch (BackingStoreException e) {
|
|
| 1101 |
// TODO Auto-generated catch block |
|
| 1102 |
e.printStackTrace(); |
|
| 1103 |
} |
|
| 1104 | 1098 |
return false; |
| 1105 | 1099 |
} |
| 1106 | 1100 |
|
Formats disponibles : Unified diff