Search in sources :

Example 1 with CalDAVResource

use of org.bedework.caldav.server.CalDAVResource in project bw-calendar-engine by Bedework.

the class BwSysIntfImpl method newResourceObject.

/* ====================================================================
   *                   Files
   * ==================================================================== */
/* (non-Javadoc)
   * @see org.bedework.caldav.server.SysIntf#newResourceObject(java.lang.String)
   */
@Override
public CalDAVResource newResourceObject(final String parentPath) throws WebdavException {
    CalDAVResource r = new BwCalDAVResource(this, null);
    r.setParentPath(parentPath);
    r.setOwner(currentPrincipal);
    return r;
}
Also used : CalDAVResource(org.bedework.caldav.server.CalDAVResource)

Example 2 with CalDAVResource

use of org.bedework.caldav.server.CalDAVResource in project bw-calendar-engine by Bedework.

the class BwSysIntfImpl method getFiles.

/* (non-Javadoc)
   * @see org.bedework.caldav.server.SysIntf#getFiles(org.bedework.caldav.server.CalDAVCollection)
   */
@Override
public Collection<CalDAVResource> getFiles(final CalDAVCollection coll) throws WebdavException {
    try {
        Collection<BwResource> bwrs = getSvci().getResourcesHandler().getAll(coll.getPath());
        if (bwrs == null) {
            return null;
        }
        Collection<CalDAVResource> rs = new ArrayList<CalDAVResource>();
        for (BwResource r : bwrs) {
            rs.add(new BwCalDAVResource(this, r));
        }
        return rs;
    } catch (CalFacadeAccessException cfae) {
        throw new WebdavForbidden();
    } catch (CalFacadeException cfe) {
        throw new WebdavException(cfe);
    } catch (Throwable t) {
        throw new WebdavException(t);
    }
}
Also used : CalDAVResource(org.bedework.caldav.server.CalDAVResource) WebdavForbidden(org.bedework.webdav.servlet.shared.WebdavForbidden) BwResource(org.bedework.calfacade.BwResource) ArrayList(java.util.ArrayList) WebdavException(org.bedework.webdav.servlet.shared.WebdavException) CalFacadeAccessException(org.bedework.calfacade.exc.CalFacadeAccessException) CalFacadeException(org.bedework.calfacade.exc.CalFacadeException)

Aggregations

CalDAVResource (org.bedework.caldav.server.CalDAVResource)2 ArrayList (java.util.ArrayList)1 BwResource (org.bedework.calfacade.BwResource)1 CalFacadeAccessException (org.bedework.calfacade.exc.CalFacadeAccessException)1 CalFacadeException (org.bedework.calfacade.exc.CalFacadeException)1 WebdavException (org.bedework.webdav.servlet.shared.WebdavException)1 WebdavForbidden (org.bedework.webdav.servlet.shared.WebdavForbidden)1