From: Wolfgang M. M. <wol...@us...> - 2004-09-12 12:41:01
|
Update of /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31404/src/org/exist/xmlrpc Modified Files: RpcConnection.java Log Message: RemoteCollection.getResource should return null instead of throwing an exception if the resource does not exist. Index: RpcConnection.java =================================================================== RCS file: /cvsroot/exist/eXist-1.0/src/org/exist/xmlrpc/RpcConnection.java,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** RpcConnection.java 12 Sep 2004 09:25:19 -0000 1.69 --- RpcConnection.java 12 Sep 2004 12:40:51 -0000 1.70 *************** *** 355,375 **** } ! Hashtable describeResource(User user, String resourceName) throws EXistException, PermissionDeniedException { DBBroker broker = brokerPool.get(user); DocumentImpl doc = null; try { doc = (DocumentImpl) broker.openDocument(resourceName, Lock.READ_LOCK); if (doc == null) { LOG.debug("document " + resourceName + " not found!"); ! throw new EXistException("document not found"); } if (!doc.getCollection().getPermissions().validate(user, Permission.READ)) { throw new PermissionDeniedException("Not allowed to read collection"); } - Hashtable desc = new Hashtable(); - Vector collections = new Vector(); Permission perms = doc.getPermissions(); - Hashtable hash = new Hashtable(5); hash.put("name", resourceName); hash.put("owner", perms.getOwner()); --- 355,373 ---- } ! public Hashtable describeResource(User user, String resourceName) throws EXistException, PermissionDeniedException { DBBroker broker = brokerPool.get(user); DocumentImpl doc = null; + Hashtable hash = new Hashtable(5); try { doc = (DocumentImpl) broker.openDocument(resourceName, Lock.READ_LOCK); if (doc == null) { LOG.debug("document " + resourceName + " not found!"); ! return hash; } if (!doc.getCollection().getPermissions().validate(user, Permission.READ)) { throw new PermissionDeniedException("Not allowed to read collection"); } Permission perms = doc.getPermissions(); hash.put("name", resourceName); hash.put("owner", perms.getOwner()); |