summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Branson <andrew.branson@cern.ch>2013-01-15 16:43:35 +0100
committerAndrew Branson <andrew.branson@cern.ch>2013-01-15 16:43:35 +0100
commitff88b42c89c3e70fcb53ff2b8ed8c8d2f20dedb1 (patch)
tree104ae25a531bdba67c015af6756a60426af0c75b
parentc98f26d7a3c0bca7d22742f14a31964ccba0afe7 (diff)
getClusterContents didn't work properly at the root Item level
-rw-r--r--src/main/java/com/c2kernel/persistency/XMLDBClusterStorage.java7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/main/java/com/c2kernel/persistency/XMLDBClusterStorage.java b/src/main/java/com/c2kernel/persistency/XMLDBClusterStorage.java
index 2aefe97..205876d 100644
--- a/src/main/java/com/c2kernel/persistency/XMLDBClusterStorage.java
+++ b/src/main/java/com/c2kernel/persistency/XMLDBClusterStorage.java
@@ -175,7 +175,6 @@ public class XMLDBClusterStorage extends ClusterStorage {
throws ClusterStorageException {
String resName = getPath(obj);
- String type = obj.getClusterType();
String strSysKey = String.valueOf(sysKey);
Collection itemColl = verifyCollection(db, strSysKey, true);
@@ -200,7 +199,6 @@ public class XMLDBClusterStorage extends ClusterStorage {
@Override
public void delete(Integer sysKey, String path)
throws ClusterStorageException {
- String type = ClusterStorage.getClusterType(path);
String strSysKey = String.valueOf(sysKey);
Collection itemColl = verifyCollection(db, strSysKey, false);
if (itemColl == null) return;
@@ -223,21 +221,18 @@ public class XMLDBClusterStorage extends ClusterStorage {
@Override
public String[] getClusterContents(Integer sysKey, String path)
throws ClusterStorageException {
- String type = ClusterStorage.getClusterType(path);
String strSysKey = String.valueOf(sysKey);
Collection coll = verifyCollection(db, strSysKey, false);
if (coll == null) return new String[0];
-
ArrayList<String> contents = new ArrayList<String>();
// Find prefix for our path level
StringBuffer resPrefix = new StringBuffer();
String[] pathComps = path.split("/");
- if (pathComps.length > 1)
+ if (pathComps.length > 0)
for (int i = 0; i < pathComps.length; i++) {
if (pathComps[i].length()>0) resPrefix.append(pathComps[i]).append(".");
}
-
// Look at each entry for matches. Trim off the ends.
try {
for (String res: coll.listResources()) {