Search in sources :

Example 1 with NotificationProperties

use of org.bedework.calfacade.configs.NotificationProperties in project bw-calendar-engine by Bedework.

the class BwSysIntfImpl method doNoteHeader.

/* ====================================================================
   *                         Private methods
   * ==================================================================== */
private String doNoteHeader(final String hdr, final String account) throws WebdavException {
    if (hdr == null) {
        return account;
    }
    try {
        final String[] hparts = hdr.split(":");
        if (hparts.length != 2) {
            throw new WebdavBadRequest();
        }
        final String id = hparts[0];
        final NotificationProperties nprops = configs.getNotificationProps();
        final String token = hparts[1];
        if (id == null) {
            throw new WebdavBadRequest();
        }
        if (!id.equals(nprops.getNotifierId()) || (token == null) || !token.equals(nprops.getNotifierToken())) {
            throw new WebdavBadRequest();
        }
        if (account != null) {
            return account;
        }
        return id;
    } catch (final WebdavException wde) {
        throw wde;
    } catch (final Throwable t) {
        throw new WebdavException(t);
    }
}
Also used : WebdavBadRequest(org.bedework.webdav.servlet.shared.WebdavBadRequest) NotificationProperties(org.bedework.calfacade.configs.NotificationProperties) WebdavException(org.bedework.webdav.servlet.shared.WebdavException)

Aggregations

NotificationProperties (org.bedework.calfacade.configs.NotificationProperties)1 WebdavBadRequest (org.bedework.webdav.servlet.shared.WebdavBadRequest)1 WebdavException (org.bedework.webdav.servlet.shared.WebdavException)1