[Bedework-commit] caldav r152 -
trunk/bwcaldav/src/org/bedework/caldav/bwserver
svnadmin at bedework.org
svnadmin at bedework.org
Mon Apr 16 14:17:16 EDT 2007
Author: douglm
Date: 2007-04-16 14:17:16 -0400 (Mon, 16 Apr 2007)
New Revision: 152
Modified:
trunk/bwcaldav/src/org/bedework/caldav/bwserver/BwSysIntfImpl.java
Log:
Add some code (not working yet) to move and rename calendars.
Modified: trunk/bwcaldav/src/org/bedework/caldav/bwserver/BwSysIntfImpl.java
===================================================================
--- trunk/bwcaldav/src/org/bedework/caldav/bwserver/BwSysIntfImpl.java 2007-04-16 17:07:25 UTC (rev 151)
+++ trunk/bwcaldav/src/org/bedework/caldav/bwserver/BwSysIntfImpl.java 2007-04-16 18:17:16 UTC (rev 152)
@@ -597,6 +597,27 @@
BwCalendar to,
boolean copy,
boolean overwrite) throws WebdavException {
+ try {
+ if (!copy) {
+ /* Move the from collection to the new location "to".
+ * If the parent calendar is the same in both cases, this is just a rename.
+ */
+ if ((from.getCalendar() == null) || (to.getCalendar() == null)) {
+ throw new WebdavForbidden("Cannot move root");
+ }
+
+ if (from.getCalendar().equals(to.getCalendar())) {
+ getSvci().renameCalendar(from, to.getName());
+ }
+ }
+ } catch (CalFacadeAccessException cfae) {
+ throw new WebdavForbidden();
+ } catch (CalFacadeException cfe) {
+ throw new WebdavException(cfe);
+ } catch (Throwable t) {
+ throw new WebdavException(t);
+ }
+
throw new WebdavException("unimplemented");
}
More information about the Bedework-commit
mailing list