Package net.fortuna.ical4j.connector.dav
Class AbstractDavObjectStore<C extends ObjectCollection<?>>
- java.lang.Object
-
- net.fortuna.ical4j.connector.dav.AbstractDavObjectStore<C>
-
- Type Parameters:
C
- the supported collection type Created: [20/11/2008]
- All Implemented Interfaces:
ObjectStore<C>
- Direct Known Subclasses:
CalDavCalendarStore
,CardDavStore
public abstract class AbstractDavObjectStore<C extends ObjectCollection<?>> extends Object implements ObjectStore<C>
-
-
Field Summary
Fields Modifier and Type Field Description protected PathResolver
pathResolver
Server implementation-specific path resolution.
-
Constructor Summary
Constructors Constructor Description AbstractDavObjectStore(URL url, PathResolver pathResolver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
connect()
Connect to a object store anonymously.boolean
connect(String bearerAuth)
boolean
connect(String username, char[] password)
Connect to a object store using the specified credentials.void
disconnect()
DavClient
getClient()
URL
getHostURL()
String
getPath()
protected String
getUserName()
This method is needed to "propfind" the user's principals.boolean
isConnected()
boolean
isSupportCalendarProxy()
List<SupportedFeature>
supportedFeatures()
Returns a list of supported features, based on the DAV header in the response of the connect call.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.fortuna.ical4j.connector.ObjectStore
addCollection, addCollection, getCollection, getCollections, removeCollection
-
-
-
-
Field Detail
-
pathResolver
protected final PathResolver pathResolver
Server implementation-specific path resolution.
-
-
Constructor Detail
-
AbstractDavObjectStore
public AbstractDavObjectStore(URL url, PathResolver pathResolver)
- Parameters:
url
- the URL of a CalDAV server instancepathResolver
- the path resolver for the CalDAV server type
-
-
Method Detail
-
getPath
public final String getPath()
- Returns:
- the path
-
connect
public final boolean connect() throws ObjectStoreException
Connect to a object store anonymously.- Specified by:
connect
in interfaceObjectStore<C extends ObjectCollection<?>>
- Returns:
- true if connection is successful, otherwise false
- Throws:
ObjectStoreException
- where an unexpected error occurs
-
connect
public final boolean connect(String bearerAuth) throws ObjectStoreException
- Throws:
ObjectStoreException
-
connect
public final boolean connect(String username, char[] password) throws ObjectStoreException
Connect to a object store using the specified credentials.- Specified by:
connect
in interfaceObjectStore<C extends ObjectCollection<?>>
- Parameters:
username
- connection usernamepassword
- connection password- Returns:
- true if connection is successful, otherwise false
- Throws:
FailedOperationException
IOException
ObjectStoreException
- where an unexpected error occurs
-
disconnect
public final void disconnect()
- Specified by:
disconnect
in interfaceObjectStore<C extends ObjectCollection<?>>
-
isConnected
public final boolean isConnected()
- Specified by:
isConnected
in interfaceObjectStore<C extends ObjectCollection<?>>
- Returns:
- true if connected to the server, otherwise false
-
getUserName
protected String getUserName()
This method is needed to "propfind" the user's principals.- Returns:
- the username stored in the HTTP credentials
-
getClient
public DavClient getClient()
-
getHostURL
public URL getHostURL()
-
supportedFeatures
public List<SupportedFeature> supportedFeatures()
Returns a list of supported features, based on the DAV header in the response of the connect call.- Returns:
-
isSupportCalendarProxy
public boolean isSupportCalendarProxy()
-
-