public class CardDavStore extends Object
| Modifier and Type | Class and Description |
|---|---|
class |
CardDavStore.SyncRef
a synchronisation reference
|
| Modifier and Type | Field and Description |
|---|---|
protected static Logger |
LOGGER |
protected static Map<String,Properties> |
propMap |
| Constructor and Description |
|---|
CardDavStore(File vcardPath,
String title)
read this store from a single VCardFile (or directory)
|
CardDavStore(String host,
String path)
create a Card Dav Store
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(ezvcard.VCard vcard,
String uidToUse)
add the given vcard
|
List<ezvcard.VCard> |
backup()
backup all my vcards
|
void |
diff(CardDavStore other)
check the difference between two stores
|
void |
diff(Map<String,ezvcard.VCard> self,
Map<String,ezvcard.VCard> other,
String thisTitle,
String otherTitle) |
String |
getBackupPath() |
void |
getBackupPath(String backupPath) |
static CardDavStore |
getCardDavStore(String user)
get the CardDav Store for the given user
|
String |
getHost() |
String |
getPassword() |
String |
getPath() |
static String |
getProperty(String user,
String propName)
get the given Property for the given user
|
static File |
getPropertyFile(String user)
get the property file for the given user
|
Map<String,com.github.sardine.DavResource> |
getResourceMap() |
String |
getSyncUid(ezvcard.VCard vcard)
get the Synchronization uid
|
String |
getTitle() |
String |
getUid(com.github.sardine.DavResource ref)
get the Uid for the given VCard reference
|
String |
getUsername() |
ezvcard.VCard |
getVCardFromRef(com.github.sardine.DavResource ref)
get the VCard for the given ref
|
void |
getVCardRefs()
get a map of VCard references from the server if the map is empty
|
List<ezvcard.VCard> |
getVCards(int limit)
get the VCards for this store
|
boolean |
isDebug() |
void |
prepareSync()
prepare the synchronization by creating a map of Synchronization References
|
void |
read(File vcardPath) |
void |
readFromBackup()
read me from the backup directory
|
void |
remove(String uid)
remove the given vcard
|
void |
setDebug(boolean debug) |
void |
setHost(String host) |
void |
setPassword(String password) |
void |
setPath(String path) |
void |
setResourceMap(Map<String,com.github.sardine.DavResource> resourceMap) |
void |
setTitle(String title) |
void |
setUsername(String username) |
void |
sync()
Synchronize my local store with the server
|
void |
synchronizationStatistics() |
void |
write(ezvcard.VCard vcard,
File vCardFile,
com.github.sardine.DavResource ref)
write the given vcard to the given vCardFile using the given ref
|
protected static Logger LOGGER
protected static Map<String,Properties> propMap
public CardDavStore(String host, String path)
host - path - public CardDavStore(File vcardPath, String title) throws IOException
vcardPath - title - - the title for this CardfileIOExceptionpublic String getTitle()
public void setTitle(String title)
title - the title to setpublic String getBackupPath()
public void getBackupPath(String backupPath)
backupPath - the backupPath to setpublic String getUsername()
public void setUsername(String username)
username - the username to setpublic String getPassword()
public void setPassword(String password)
password - the password to setpublic String getHost()
public void setHost(String host)
host - the host to setpublic String getPath()
public void setPath(String path)
path - the path to setpublic boolean isDebug()
public void setDebug(boolean debug)
debug - the debug to setpublic static File getPropertyFile(String user)
user - public static String getProperty(String user, String propName) throws FileNotFoundException, IOException
user - propName - FileNotFoundExceptionIOExceptionpublic static CardDavStore getCardDavStore(String user) throws Exception
user - Exceptionpublic void add(ezvcard.VCard vcard,
String uidToUse)
vcard - uidToUse - public void read(File vcardPath) throws IOException
IOExceptionpublic String getSyncUid(ezvcard.VCard vcard)
vcard - public void getVCardRefs()
throws Exception
Exceptionpublic void prepareSync()
throws Exception
Exceptionpublic ezvcard.VCard getVCardFromRef(com.github.sardine.DavResource ref)
throws Exception
ref - Exceptionpublic void write(ezvcard.VCard vcard,
File vCardFile,
com.github.sardine.DavResource ref)
throws Exception
vcard - vCardFile - ref - Exceptionpublic String getUid(com.github.sardine.DavResource ref)
ref - public void sync()
throws Exception
Exceptionpublic void synchronizationStatistics()
public void diff(Map<String,ezvcard.VCard> self, Map<String,ezvcard.VCard> other, String thisTitle, String otherTitle)
public void diff(CardDavStore other)
other - public List<ezvcard.VCard> getVCards(int limit) throws Exception
limit - - the maximum number of cards to getExceptionpublic void readFromBackup()
throws IOException
IOExceptionCopyright © 2019 BITPlan GmbH. All rights reserved.