src/macosx/classes/java/util/prefs/MacOSXPreferencesFile.java

Print this page




 343     }
 344 
 345 
 346     // Node manipulation
 347     boolean addNode(String path)
 348     {
 349         synchronized(MacOSXPreferencesFile.class) {
 350             markChanged();
 351             return addNode(path, appName, user, host);
 352         }
 353     }
 354 
 355     void removeNode(String path)
 356     {
 357         synchronized(MacOSXPreferencesFile.class) {
 358             markChanged();
 359             removeNode(path, appName, user, host);
 360         }
 361     }
 362 
 363     void addChildToNode(String path, String child)
 364     {
 365         synchronized(MacOSXPreferencesFile.class) {
 366             markChanged();
 367             addChildToNode(path, child+"/", appName, user, host);
 368         }
 369     }
 370 
 371     void removeChildFromNode(String path, String child)
 372     {
 373         synchronized(MacOSXPreferencesFile.class) {
 374             markChanged();
 375             removeChildFromNode(path, child+"/", appName, user, host);
 376         }
 377     }
 378 
 379 
 380     // Key manipulation
 381     void addKeyToNode(String path, String key, String value)
 382     {
 383         synchronized(MacOSXPreferencesFile.class) {
 384             markChanged();
 385             addKeyToNode(path, key, value, appName, user, host);
 386         }
 387     }


 416             return getKeysForNode(path, appName, user, host);
 417         }
 418     }
 419 
 420 
 421     // Synchronization
 422     boolean synchronize()
 423     {
 424         synchronized(MacOSXPreferencesFile.class) {
 425             return synchronize(appName, user, host);
 426         }
 427     }
 428 
 429 
 430     // CF functions
 431     // Must be called when synchronized on MacOSXPreferencesFile.class
 432     private static final native boolean
 433         addNode(String path, String name, long user, long host);
 434     private static final native void
 435         removeNode(String path, String name, long user, long host);
 436     private static final native void
 437         addChildToNode(String path, String child,
 438                        String name, long user, long host);
 439     private static final native void
 440         removeChildFromNode(String path, String child,
 441                             String name, long user, long host);
 442     private static final native void
 443         addKeyToNode(String path, String key, String value,
 444                      String name, long user, long host);
 445     private static final native void
 446         removeKeyFromNode(String path, String key,
 447                           String name, long user, long host);
 448     private static final native String
 449         getKeyFromNode(String path, String key,
 450                        String name, long user, long host);
 451     private static final native String[]
 452         getChildrenForNode(String path, String name, long user, long host);
 453     private static final native String[]
 454         getKeysForNode(String path, String name, long user, long host);
 455     private static final native boolean
 456         synchronize(String name, long user, long host);


 343     }
 344 
 345 
 346     // Node manipulation
 347     boolean addNode(String path)
 348     {
 349         synchronized(MacOSXPreferencesFile.class) {
 350             markChanged();
 351             return addNode(path, appName, user, host);
 352         }
 353     }
 354 
 355     void removeNode(String path)
 356     {
 357         synchronized(MacOSXPreferencesFile.class) {
 358             markChanged();
 359             removeNode(path, appName, user, host);
 360         }
 361     }
 362 
 363     boolean addChildToNode(String path, String child)
 364     {
 365         synchronized(MacOSXPreferencesFile.class) {
 366             markChanged();
 367             return addChildToNode(path, child+"/", appName, user, host);
 368         }
 369     }
 370 
 371     void removeChildFromNode(String path, String child)
 372     {
 373         synchronized(MacOSXPreferencesFile.class) {
 374             markChanged();
 375             removeChildFromNode(path, child+"/", appName, user, host);
 376         }
 377     }
 378 
 379 
 380     // Key manipulation
 381     void addKeyToNode(String path, String key, String value)
 382     {
 383         synchronized(MacOSXPreferencesFile.class) {
 384             markChanged();
 385             addKeyToNode(path, key, value, appName, user, host);
 386         }
 387     }


 416             return getKeysForNode(path, appName, user, host);
 417         }
 418     }
 419 
 420 
 421     // Synchronization
 422     boolean synchronize()
 423     {
 424         synchronized(MacOSXPreferencesFile.class) {
 425             return synchronize(appName, user, host);
 426         }
 427     }
 428 
 429 
 430     // CF functions
 431     // Must be called when synchronized on MacOSXPreferencesFile.class
 432     private static final native boolean
 433         addNode(String path, String name, long user, long host);
 434     private static final native void
 435         removeNode(String path, String name, long user, long host);
 436     private static final native boolean
 437         addChildToNode(String path, String child,
 438                        String name, long user, long host);
 439     private static final native void
 440         removeChildFromNode(String path, String child,
 441                             String name, long user, long host);
 442     private static final native void
 443         addKeyToNode(String path, String key, String value,
 444                      String name, long user, long host);
 445     private static final native void
 446         removeKeyFromNode(String path, String key,
 447                           String name, long user, long host);
 448     private static final native String
 449         getKeyFromNode(String path, String key,
 450                        String name, long user, long host);
 451     private static final native String[]
 452         getChildrenForNode(String path, String name, long user, long host);
 453     private static final native String[]
 454         getKeysForNode(String path, String name, long user, long host);
 455     private static final native boolean
 456         synchronize(String name, long user, long host);