}
public Item getItem(String s) throws PathNotFoundException, RepositoryException {
Item anItem = null;
CollectionImpl collection = null;
String[] tempArr = null;
String tempPath = s; // example:tempP="/abc/post/test";
if ((tempPath != null) && (tempPath.contains("["))) {
tempPath = tempPath.substring(1, tempPath.length() - 1);
}
if ((tempPath != null) && (tempPath.contains("/"))) {
tempArr = tempPath.split("/");
if (tempArr.length == 2) {
tempPath = "/";
} else {
tempPath = tempPath.substring(0, (tempPath.length()) -
(tempArr[tempArr.length - 1].length()) - 1); //parent path
}
try {
if (userRegistry.resourceExists(s)) {
if (userRegistry.get(s) instanceof CollectionImpl) {
anItem = new RegistryNode(s, this);
} else {
if (userRegistry.resourceExists(tempPath)) {
anItem = new RegistryNode(tempPath, this).getProperty(tempArr[tempArr.length - 1]);
}
}
} else {
if ((userRegistry.resourceExists(tempPath))) { // tempPath is the parent path
CollectionImpl parentCol = (CollectionImpl) userRegistry.get(tempPath); //need to know the int values to be passed
if ((parentCol != null) && (parentCol.getProperty(tempArr[tempArr.length - 1]) != null)) {
anItem = new RegistryProperty(parentCol, this, tempArr[tempArr.length - 1]);
((RegistryProperty) anItem).setValue(parentCol.getProperty(tempArr[tempArr.length - 1]));
}
}
}