public PreferencesImpl[] loadAll(BackingStoreManager manager, Long bundleId) throws BackingStoreException {
final Session session = this.checkInitialized();
try {
final List<PreferencesImpl> list = new ArrayList<PreferencesImpl>();
// check for system preferences
final PreferencesDescription systemDesc = new PreferencesDescription(bundleId, null);
final String systemPath = this.getNodePath(systemDesc);
if ( session.itemExists(systemPath) ) {
final Node rootNode = (Node)session.getItem(systemPath);
final PreferencesImpl root = new PreferencesImpl(systemDesc, manager);
this.readTree(root, session, rootNode);
}
// user preferences
final String userPath = this.rootNodePath + '/' + bundleId + '/' + "users";
if ( session.itemExists(userPath) ) {
final NodeIterator iterator = ((Node)session.getItem(userPath)).getNodes();
while ( iterator.hasNext() ) {
final Node current = iterator.nextNode();
final PreferencesDescription desc = new PreferencesDescription(bundleId, current.getName());
final PreferencesImpl root = new PreferencesImpl(desc, manager);
this.readTree(root, session, current);
list.add(root);