Interface SysIntf
- All Superinterfaces:
org.bedework.webdav.servlet.shared.WdSysIntf
We're using the bedework object classes here. To simplify matters (a little) we don't have distinct event, task and journal classes. They are all currently the BwEvent class with an entityType defining what the object represents.
- Author:
- Mike Douglass douglm at rpi.edu
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumExpected result typestatic enumWhat method do we want emittedstatic classResult for a single recipient.static classData for Synch Reportstatic classShow the outcome of an update -
Method Summary
Modifier and TypeMethodDescriptionaddEvent(CalDAVEvent<?> ev, boolean noInvites, boolean rollbackOnError) Add an event/task/journal.booleantrue if bedework extensions are enabled for the request.org.bedework.access.AccessPrincipalcaladdrToPrincipal(String caladdr) Given a calendar address return the associated calendar account.org.bedework.access.CurrentAccesscheckAccess(org.bedework.webdav.servlet.shared.WdEntity<?> ent, int desiredAccess, boolean returnResult) Check the access for the given entity.voidclose()End any transactions.voidcopyMove(CalDAVCollection<?> from, CalDAVCollection<?> to, boolean copy, boolean overwrite) Copy or move the collection to another location.booleancopyMove(CalDAVEvent<?> from, CalDAVCollection<?> to, String name, boolean copy, boolean overwrite) Copy or move the given entity to the destination collection with the given name.booleancopyMoveFile(CalDAVResource<?> from, String toPath, String name, boolean copy, boolean overwrite) Copy or move the given file to the destination collection with the given name.voiddeleteCollection(CalDAVCollection<?> col, boolean sendSchedulingMessage) voiddeleteEvent(CalDAVEvent<?> ev, boolean scheduleReply) voiddeleteFile(CalDAVResource<?> val) Delete a file.fromIcal(CalDAVCollection<?> col, IcalendarType ical, SysIntf.IcalResultType rtype) Convert the Icalendar object to a Collection of Calendar objectsfromIcal(CalDAVCollection<?> col, Reader rdr, String contentType, SysIntf.IcalResultType rtype, boolean mergeAttendees) Convert the Icalendar reader to a Collection of Calendar objectsReturn CalDAV properties relevant to authentication state.getCalPrincipalInfo(org.bedework.access.AccessPrincipal principal) Given a valid AccessPrincipal return the associated calendar user information needed for caldav interactions.getCollection(String path) Get a collection given the pathgetCollections(CalDAVCollection<?> col) Returns children of the given collection to which the current user has some access.CalDAVEvent<?>getEvent(CalDAVCollection<?> col, String val) Get events given the collection and String name.getEvents(CalDAVCollection<?> col, FilterBase filter, List<String> retrieveList, RetrievalMode recurRetrieval) Return the events for the current user in the given collection using the supplied filter.getFile(CalDAVCollection<?> coll, String name) GET a file.voidgetFileContent(CalDAVResource<?> val) Get resource content given the resource.getFiles(CalDAVCollection<?> coll) Get the files in a collection.CalDAVEvent<?>getFreeBusy(CalDAVCollection<?> col, int depth, TimeRange timeRange) Generate a free busy object for the given time period which reflects the state of the given collection.Return a set of hrefs for each resource affecting this users freebusyThe urls should be principal urls.getInviteStatus(CalDAVCollection<?> col) getNotifications(String href, QName type) org.bedework.access.AccessPrincipalReturn the current principalorg.bedework.access.AccessPrincipalgetPrincipal(String href) Return principal information for the given href.getPrincipalCollectionSet(String resourceUri) Given a uri returns a Collection of uris that allow search operations on principals for that resource.org.bedework.access.AccessPrincipalgetPrincipalForUser(String account) Return principal information for the given account.getPrincipals(String resourceUri, org.bedework.webdav.servlet.shared.PrincipalPropertySearch pps) Given a PrincipalPropertySearch returns a Collection of matching principals.Get a property handlerbyte[]getPublicKey(String domain, String service) Returns a public key for the given domain and service - either or both of which may be null.voidHandle the special freebusy resquests, i.e.getSyncReport(String path, String token, int limit, boolean recurse) getSyncToken(CalDAVCollection<?> col) Return CalDAV relevant properties about the system.org.bedework.webdav.servlet.shared.UrlHandlerinit(javax.servlet.http.HttpServletRequest req, String account, boolean service, boolean calWs, boolean synchWs, boolean notifyWs, boolean socketWs, String opaqueData) Called before any other method is called to allow initialization to take place at the first or subsequent requestsbooleanisPrincipal(String val) Does the value appear to represent a valid principal?intmakeCollection(CalDAVCollection<?> col) newCollectionObject(boolean isCalendarCollection, String parentPath) Return a new object representing the parameters.newResourceObject(String parentPath) Return a new object representing the parameters.principalToCaladdr(org.bedework.access.AccessPrincipal principal) The inverse of caladdrToPrincipalvoidputFile(CalDAVCollection<?> coll, CalDAVResource<?> val) PUT a file.voidreindexEvent(CalDAVEvent<?> event) Reindex an event after an error that may be the result of an out of date index.voidremoveNotification(String href, NotificationType val) Remove the given notification from the notification collection for the indicated calendar user.requestFreeBusy(CalDAVEvent<?> val, boolean iSchedule) Get the free busy for one or more principals based on the given VFREEBUSY request.voidrollback()Called on the way out before close if there was an error.schedule(CalDAVEvent<?> ev) Request to schedule a meeting.booleansendNotification(String href, NotificationType val) Add the given notification to the notification collection for the indicated calendar user.share(CalDAVCollection<?> col, ShareType share) sharingReply(CalDAVCollection<?> col, InviteReplyType reply) Handle a reply to a sharing notification.booleansubscribeNotification(String principalHref, String action, List<String> emails) Subscribe for email notifications to the notification engine for the indicated calendar user.booleantestMode()Allows some special handling of some requests - mostly to do with cleanup of accounts when testing.net.fortuna.ical4j.model.CalendartoCalendar(CalDAVEvent<?> ev, boolean incSchedMethod) Make an ical Calendar from an event.toIcalendar(CalDAVEvent<?> ev, boolean incSchedMethod, IcalendarType pattern) Make an XML IcalendarType from an event.toIcalString(net.fortuna.ical4j.model.Calendar cal, String contentType) Convert a Calendar to it's string formtoJcal(CalDAVEvent<?> ev, boolean incSchedMethod) Make a JSON jcal object from an event.toStringTzCalendar(String tzid) Create a Calendar object from the named timezone and convert to a String representationtzidFromTzdef(String val) Given a timezone spec return the tzidvoidupdateAccess(CalDAVCollection<?> col, org.bedework.access.Acl acl) voidupdateAccess(CalDAVEvent<?> ev, org.bedework.access.Acl acl) voidupdateCollection(CalDAVCollection<?> val) Update a collection.voidupdateEvent(CalDAVEvent<?> event) Update an event/todo/journal.updateEvent(CalDAVEvent<?> event, List<org.oasis_open.docs.ws_calendar.ns.soap.ComponentSelectionType> updates) Update the supplied event using the web services update message.voidupdateFile(CalDAVResource<?> val, boolean updateContent) Update a file.booleanvalidateAlarm(String val) Validate an alarm componentbooleanvalidPrincipal(String href) Is href a valid principal?writeCalendar(Collection<CalDAVEvent<?>> evs, SysIntf.MethodEmitted method, org.bedework.util.xml.XmlEmit xml, Writer wtr, String contentType) Write a collection of events as an ical calendar.Methods inherited from interface org.bedework.webdav.servlet.shared.WdSysIntf
allowsSyncReport, getDefaultContentType, getNotificationURL
-
Method Details
-
init
String init(javax.servlet.http.HttpServletRequest req, String account, boolean service, boolean calWs, boolean synchWs, boolean notifyWs, boolean socketWs, String opaqueData) throws org.bedework.webdav.servlet.shared.WebdavException Called before any other method is called to allow initialization to take place at the first or subsequent requests- Parameters:
req- the http servlet requestaccount- - possible accountservice- - true if this is a service call - e.g. iSchedule - rather than a real user.calWs- true if this is a CalWs-SOAP servicesynchWs- true if this is a SynchWs-SOAP servicenotifyWs- true if this is a notification servicesocketWs- true if this is a service for the websockets proxyopaqueData- possibly from headers etc.- Returns:
- the account which may have changed
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
testMode
boolean testMode()Allows some special handling of some requests - mostly to do with cleanup of accounts when testing.- Returns:
- true for test mode.
-
bedeworkExtensionsEnabled
boolean bedeworkExtensionsEnabled()true if bedework extensions are enabled for the request. Client has sent a header "X-BEDEWORK-EXTENSIONS: TRUE".Current extensions
- Extra elements in notifications
- Returns:
- true for extensions enabled.
-
getAuthProperties
CalDAVAuthProperties getAuthProperties()Return CalDAV properties relevant to authentication state.- Returns:
- CalDAVAuthProperties object - never null.
-
getSystemProperties
CalDAVSystemProperties getSystemProperties()Return CalDAV relevant properties about the system.- Returns:
- CalDAVSystemProperties object - never null.
-
getPrincipal
org.bedework.access.AccessPrincipal getPrincipal()Return the current principal- Returns:
- String
-
getPropertyHandler
Get a property handler- Parameters:
ptype-- Returns:
- PropertyHandler
-
getUrlHandler
org.bedework.webdav.servlet.shared.UrlHandler getUrlHandler()- Specified by:
getUrlHandlerin interfaceorg.bedework.webdav.servlet.shared.WdSysIntf- Returns:
- UrlHandler object to manipulate urls.
-
isPrincipal
Does the value appear to represent a valid principal?- Parameters:
val-- Returns:
- true if it's a (possible) principal
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getPrincipalForUser
org.bedework.access.AccessPrincipal getPrincipalForUser(String account) throws org.bedework.webdav.servlet.shared.WebdavException Return principal information for the given account.- Parameters:
account-- Returns:
- PrincipalInfo
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getPrincipal
org.bedework.access.AccessPrincipal getPrincipal(String href) throws org.bedework.webdav.servlet.shared.WebdavException Return principal information for the given href. Also tests for a valid principal.- Parameters:
href-- Returns:
- PrincipalInfo
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getPublicKey
byte[] getPublicKey(String domain, String service) throws org.bedework.webdav.servlet.shared.WebdavException Returns a public key for the given domain and service - either or both of which may be null.This allows us to have different keys for communication with different domains and for different services. At its simplest, both are ignored and a single key (pair) is used to secure all communications.
This is used, for example, by iSchedule for DKIM verification.
In keeping with the DKIM approach,
- if there are no keys an empty object is returned.
- To refuse keys for a domain/service return null.
- Parameters:
domain-service-- Returns:
- key, empty key object or null.
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
makeHref
- Parameters:
id-whoType- - from WhoDefs- Returns:
- String href
-
getGroups
Collection<String> getGroups(String rootUrl, String principalUrl) throws org.bedework.webdav.servlet.shared.WebdavException The urls should be principal urls. principalUrl can null for the current user. The result is a collection of principal urls of which the given url is a member, based upon rootUrl. For example, if rootUrl points to the base of the user principal hierarchy, then the rsult should be at least the current user's principal url, remembering that user principals are themselves groups and the user is considered a member of their own group.- Parameters:
rootUrl- - url to base search on.principalUrl- - url of principal or null for current user- Returns:
- Collection of urls - always non-null
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
caladdrToPrincipal
Given a calendar address return the associated calendar account. For example, we might have a calendar address
auser@ahost.org
with the associated account of
auser.
Whereever we need a user account use the converted value. Call userToCaladdr for the inverse.
- Parameters:
caladdr- calendar address- Returns:
- AccessPrincipal or null if not caladdr for this system
-
principalToCaladdr
String principalToCaladdr(org.bedework.access.AccessPrincipal principal) throws org.bedework.webdav.servlet.shared.WebdavException The inverse of caladdrToPrincipal- Parameters:
principal-- Returns:
- String calendar user address
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getCalPrincipalInfo
Given a valid AccessPrincipal return the associated calendar user information needed for caldav interactions.- Parameters:
principal- valid AccessPrincipal- Returns:
- CalUserInfo or null if not caladdr for this system
- Throws:
RuntimeException- for errors
-
getPrincipalCollectionSet
Collection<String> getPrincipalCollectionSet(String resourceUri) throws org.bedework.webdav.servlet.shared.WebdavException Given a uri returns a Collection of uris that allow search operations on principals for that resource.- Parameters:
resourceUri-- Returns:
- Collection of String
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
validPrincipal
Is href a valid principal?- Parameters:
href-- Returns:
- boolean true for a valid user
- Throws:
org.bedework.webdav.servlet.shared.WebdavException- for errors
-
subscribeNotification
boolean subscribeNotification(String principalHref, String action, List<String> emails) throws org.bedework.webdav.servlet.shared.WebdavException Subscribe for email notifications to the notification engine for the indicated calendar user.- Parameters:
principalHref- the subscriberaction- "add"/"remove"emails- addresses to add or remove- Returns:
- false for not done
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
sendNotification
boolean sendNotification(String href, NotificationType val) throws org.bedework.webdav.servlet.shared.WebdavException Add the given notification to the notification collection for the indicated calendar user.- Parameters:
href-val-- Returns:
- false for unknown CU
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
removeNotification
void removeNotification(String href, NotificationType val) throws org.bedework.webdav.servlet.shared.WebdavException Remove the given notification from the notification collection for the indicated calendar user.- Parameters:
href-val-- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getNotifications
- Returns:
- notifications for this user
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getNotifications
List<NotificationType> getNotifications(String href, QName type) throws org.bedework.webdav.servlet.shared.WebdavException - Parameters:
href- of principaltype- of notification (null for all)- Returns:
- notifications for the given principal of the given type
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
sharingReply
String sharingReply(CalDAVCollection<?> col, InviteReplyType reply) throws org.bedework.webdav.servlet.shared.WebdavException Handle a reply to a sharing notification.- Parameters:
col- - unchecked sharees calendar homereply- - the reply to the invitation with the path reset to be the relative path.- Returns:
- null for unknown sharer or no invitation otherwise the path to the new alias in the sharees calendar home.
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getInviteStatus
InviteType getInviteStatus(CalDAVCollection<?> col) throws org.bedework.webdav.servlet.shared.WebdavException - Parameters:
col-- Returns:
- current invitations
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getFreebusySet
Return a set of hrefs for each resource affecting this users freebusy- Returns:
- Collection of hrefs
- Throws:
org.bedework.webdav.servlet.shared.WebdavException- for errors
-
schedule
Collection<SysIntf.SchedRecipientResult> schedule(CalDAVEvent<?> ev) throws org.bedework.webdav.servlet.shared.WebdavException Request to schedule a meeting. The event object must have the organizer and attendees and possibly recipients set. If no recipients are set, they will be set from the attendees.The functioning of this method must conform to the requirements of iTip. The event object must have the required method (publish, request etc) set.
The event will be added to the users outbox which will trigger the send of requests to other users inboxes. For users within this system the request will be immediately addded to the recipients inbox. For external users they are sent via mail.
- Parameters:
ev- Event object- Returns:
- ScheduleResult
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
addEvent
Collection<CalDAVEvent<?>> addEvent(CalDAVEvent<?> ev, boolean noInvites, boolean rollbackOnError) throws org.bedework.webdav.servlet.shared.WebdavException Add an event/task/journal. If this is a scheduling event we are adding, determined by examining the organizer and attendee properties, we will send out invitations to the attendees, unless the noInvites flag is set.- Parameters:
ev- CalDAVEvent objectnoInvites- Set from request - if true don't send invitesrollbackOnError- true if we rollback and throw an exception on error- Returns:
- Collection of overrides which did not match or null if all matched
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
reindexEvent
Reindex an event after an error that may be the result of an out of date index.- Parameters:
event- a CalDAVEvent object
-
updateEvent
Update an event/todo/journal.- Parameters:
event- updated CalDAVEvent object- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
updateEvent
SysIntf.UpdateResult updateEvent(CalDAVEvent<?> event, List<org.oasis_open.docs.ws_calendar.ns.soap.ComponentSelectionType> updates) throws org.bedework.webdav.servlet.shared.WebdavException Update the supplied event using the web services update message.- Parameters:
event- updated CalDAVEvent objectupdates- set of updates to be applied- Returns:
- UpdateResult
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getEvents
Collection<CalDAVEvent<?>> getEvents(CalDAVCollection<?> col, FilterBase filter, List<String> retrieveList, RetrievalMode recurRetrieval) throws org.bedework.webdav.servlet.shared.WebdavException Return the events for the current user in the given collection using the supplied filter. Stored freebusy objects are returned as BwEvent objects with the appropriate entity type. If retrieveList is supplied only those fields (and a few required fields) will be returned.We flag the desired entity types.
- Parameters:
col-filter- - if non-null defines a search filterretrieveList- List of properties to retrieve or null for a full event.recurRetrieval- How recurring event is returned.- Returns:
- Collection populated event value objects
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getEvent
CalDAVEvent<?> getEvent(CalDAVCollection<?> col, String val) throws org.bedework.webdav.servlet.shared.WebdavException Get events given the collection and String name. Return null for not found. There should be only one event or none. For recurring, the overrides and possibly the instances will be attached.- Parameters:
col- CalDAVCollection objectval- String possible name- Returns:
- CalDAVEvent or null
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
deleteEvent
void deleteEvent(CalDAVEvent<?> ev, boolean scheduleReply) throws org.bedework.webdav.servlet.shared.WebdavException - Parameters:
ev-scheduleReply- - true if we want a schduling reply posted- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
requestFreeBusy
Collection<SysIntf.SchedRecipientResult> requestFreeBusy(CalDAVEvent<?> val, boolean iSchedule) throws org.bedework.webdav.servlet.shared.WebdavException Get the free busy for one or more principals based on the given VFREEBUSY request.- Parameters:
val- A representation of a scheduling freebusy request to be acted upon.iSchedule- true if this is from an ischedule request- Returns:
- ScheduleResult
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getSpecialFreeBusy
void getSpecialFreeBusy(String cua, Set<String> recipients, String originator, TimeRange tr, Writer wtr) throws org.bedework.webdav.servlet.shared.WebdavException Handle the special freebusy resquests, i.e. non-CalDAV- Parameters:
cua-originator- value of the Originator headerrecipients- values of Recipient headerstr-wtr-- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getFreeBusy
CalDAVEvent<?> getFreeBusy(CalDAVCollection<?> col, int depth, TimeRange timeRange) throws org.bedework.webdav.servlet.shared.WebdavException Generate a free busy object for the given time period which reflects the state of the given collection.- Parameters:
col-depth-timeRange-- Returns:
- CalDAVEvent - as a freebusy entity
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
updateAccess
void updateAccess(CalDAVEvent<?> ev, org.bedework.access.Acl acl) throws org.bedework.webdav.servlet.shared.WebdavException - Parameters:
ev-acl-- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
copyMove
boolean copyMove(CalDAVEvent<?> from, CalDAVCollection<?> to, String name, boolean copy, boolean overwrite) throws org.bedework.webdav.servlet.shared.WebdavException Copy or move the given entity to the destination collection with the given name. Status is set on return- Parameters:
from- Source entityto- Destination collectionname- String name of new entitycopy- true for copyingoverwrite- destination exists- Returns:
- true if destination created (i.e. not updated)
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
newCollectionObject
Return a new object representing the parameters. No collection is created. makeCollection must be called subsequently with the object.- Parameters:
isCalendarCollection-parentPath-- Returns:
- CalDAVCollection
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
updateAccess
void updateAccess(CalDAVCollection<?> col, org.bedework.access.Acl acl) throws org.bedework.webdav.servlet.shared.WebdavException - Parameters:
col-acl-- Throws:
org.bedework.webdav.servlet.shared.WebdavException- on fatal error
-
makeCollection
int makeCollection(CalDAVCollection<?> col) throws org.bedework.webdav.servlet.shared.WebdavException - Parameters:
col- Initialised collection object- Returns:
- int status
- Throws:
org.bedework.webdav.servlet.shared.WebdavException- on fatal error
-
copyMove
void copyMove(CalDAVCollection<?> from, CalDAVCollection<?> to, boolean copy, boolean overwrite) throws org.bedework.webdav.servlet.shared.WebdavException Copy or move the collection to another location. Status is set on return- Parameters:
from- Source collectionto- Destination collectioncopy- true for copyingoverwrite- destination exists- Throws:
org.bedework.webdav.servlet.shared.WebdavException- on fatal error
-
getCollection
CalDAVCollection<?> getCollection(String path) throws org.bedework.webdav.servlet.shared.WebdavException Get a collection given the path- Parameters:
path- String path of collection- Returns:
- CalDAVCollection null for unknown collection
- Throws:
org.bedework.webdav.servlet.shared.WebdavException- on fatal error
-
updateCollection
void updateCollection(CalDAVCollection<?> val) throws org.bedework.webdav.servlet.shared.WebdavException Update a collection.- Parameters:
val- updated CalDAVCollection object- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
deleteCollection
void deleteCollection(CalDAVCollection<?> col, boolean sendSchedulingMessage) throws org.bedework.webdav.servlet.shared.WebdavException - Parameters:
col- to deletesendSchedulingMessage- true if we should send cancels- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getCollections
Collection<CalDAVCollection<?>> getCollections(CalDAVCollection<?> col) throws org.bedework.webdav.servlet.shared.WebdavException Returns children of the given collection to which the current user has some access.- Parameters:
col- parent collection- Returns:
- Collection of CalDAVCollection
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
newResourceObject
CalDAVResource<?> newResourceObject(String parentPath) throws org.bedework.webdav.servlet.shared.WebdavException Return a new object representing the parameters. No resource is created. putFile must be called subsequently with the object.- Parameters:
parentPath-- Returns:
- CalDAVResource
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
putFile
void putFile(CalDAVCollection<?> coll, CalDAVResource<?> val) throws org.bedework.webdav.servlet.shared.WebdavException PUT a file.- Parameters:
coll- CalDAVCollection defining recipient collectionval- CalDAVResource- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getFile
CalDAVResource<?> getFile(CalDAVCollection<?> coll, String name) throws org.bedework.webdav.servlet.shared.WebdavException GET a file.- Parameters:
coll- CalDAVCollection containing filename-- Returns:
- CalDAVResource
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getFileContent
Get resource content given the resource. It will be set in the resource object- Parameters:
val- CalDAVResource- Throws:
RuntimeException- on fatal error
-
getFiles
Collection<CalDAVResource<?>> getFiles(CalDAVCollection<?> coll) throws org.bedework.webdav.servlet.shared.WebdavException Get the files in a collection.- Parameters:
coll- CalDAVCollection containing file- Returns:
- Collection of CalDAVResource
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
updateFile
void updateFile(CalDAVResource<?> val, boolean updateContent) throws org.bedework.webdav.servlet.shared.WebdavException Update a file.- Parameters:
val- CalDAVResourceupdateContent- if true we also update the content- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
deleteFile
Delete a file.- Parameters:
val- CalDAVResource- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
copyMoveFile
boolean copyMoveFile(CalDAVResource<?> from, String toPath, String name, boolean copy, boolean overwrite) throws org.bedework.webdav.servlet.shared.WebdavException Copy or move the given file to the destination collection with the given name. Status is set on return- Parameters:
from- Source resourcetoPath- Destination collection pathname- String name of new entitycopy- true for copyingoverwrite- destination exists- Returns:
- true if destination created (i.e. not updated)
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getSyncToken
String getSyncToken(CalDAVCollection<?> col) throws org.bedework.webdav.servlet.shared.WebdavException - Parameters:
col-- Returns:
- A sync-token which must be a URI.
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getSyncReport
SysIntf.SynchReportData getSyncReport(String path, String token, int limit, boolean recurse) throws org.bedework.webdav.servlet.shared.WebdavException - Parameters:
path-token-limit- - negative for no limit on result set sizerecurse-- Returns:
- report
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
toCalendar
net.fortuna.ical4j.model.Calendar toCalendar(CalDAVEvent<?> ev, boolean incSchedMethod) throws org.bedework.webdav.servlet.shared.WebdavException Make an ical Calendar from an event.- Parameters:
ev-incSchedMethod- - true if we should emit the scheduling method- Returns:
- Calendar
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
toIcalendar
IcalendarType toIcalendar(CalDAVEvent<?> ev, boolean incSchedMethod, IcalendarType pattern) throws org.bedework.webdav.servlet.shared.WebdavException Make an XML IcalendarType from an event.- Parameters:
ev-incSchedMethod- - true if we should emit the scheduling methodpattern- - non-null to restrict returned properties- Returns:
- IcalendarType
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
toJcal
String toJcal(CalDAVEvent<?> ev, boolean incSchedMethod) throws org.bedework.webdav.servlet.shared.WebdavException Make a JSON jcal object from an event.- Parameters:
ev- event to convertincSchedMethod- - true if we should emit the scheduling method- Returns:
- String jcal representation
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
toIcalString
String toIcalString(net.fortuna.ical4j.model.Calendar cal, String contentType) throws org.bedework.webdav.servlet.shared.WebdavException Convert a Calendar to it's string form- Parameters:
cal- Calendar to convertcontentType-- Returns:
- String representation
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
writeCalendar
String writeCalendar(Collection<CalDAVEvent<?>> evs, SysIntf.MethodEmitted method, org.bedework.util.xml.XmlEmit xml, Writer wtr, String contentType) throws org.bedework.webdav.servlet.shared.WebdavException Write a collection of events as an ical calendar.- Parameters:
evs-method- - what scheduling method?xml- - if this is embedded in an xml streamwtr- - if standalone output or no xml stream initialized.contentType- - requested type. null for default- Returns:
- actual contentType written
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
fromIcal
SysiIcalendar fromIcal(CalDAVCollection<?> col, Reader rdr, String contentType, SysIntf.IcalResultType rtype, boolean mergeAttendees) throws org.bedework.webdav.servlet.shared.WebdavException Convert the Icalendar reader to a Collection of Calendar objects- Parameters:
col- collection in which to place entitiesrdr-contentType- null for ICalendar or valid calendar mime typertype-mergeAttendees- True if we should only update our own attendee.- Returns:
- SysiIcalendar
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
fromIcal
SysiIcalendar fromIcal(CalDAVCollection<?> col, IcalendarType ical, SysIntf.IcalResultType rtype) throws org.bedework.webdav.servlet.shared.WebdavException Convert the Icalendar object to a Collection of Calendar objects- Parameters:
col- collection in which to place entitiesical-rtype-- Returns:
- SysiIcalendar
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
toStringTzCalendar
Create a Calendar object from the named timezone and convert to a String representation- Parameters:
tzid- String timezone id- Returns:
- String
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
tzidFromTzdef
Given a timezone spec return the tzid- Parameters:
val-- Returns:
- String tzid or null for failure
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
validateAlarm
Validate an alarm component- Parameters:
val-- Returns:
- boolean false for failure
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
rollback
void rollback()Called on the way out before close if there was an error. -
close
void close() throws org.bedework.webdav.servlet.shared.WebdavExceptionEnd any transactions.- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-