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);
}
}
Aggregations