AutoCloseablepublic final class SimpleCollection extends Object implements AutoCloseable
| Constructor | Description |
|---|---|
SimpleCollection() |
The default collection.
|
SimpleCollection(String label,
CharSequence password) |
A user specified collection.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
clear() |
clear the passphrase of the collection.
|
void |
close() |
|
String |
createPassword(String label,
CharSequence password) |
Creates an item with the provided properties in this collection.
|
String |
createPassword(String label,
CharSequence password,
Map<String,String> attributes) |
Creates an item with the provided properties in this collection.
|
void |
delete() |
Delete this collection.
|
void |
deletePassword(String objectPath) |
Delete an item from this collection.
|
void |
deletePasswords(List<String> objectPaths) |
Delete specified items from this collection.
|
Map<String,String> |
getAttributes(String objectPath) |
Get the user specified attributes of an item.
|
String |
getLabel(String objectPath) |
Get the displayable label of an item.
|
char[] |
getPassword(String objectPath) |
Get the secret of the item.
|
Map<String,char[]> |
getPasswords() |
Get the secrets from this collection.
|
void |
updatePassword(String objectPath,
String label,
CharSequence password,
Map<String,String> attributes) |
Updates an item with the provided properties.
|
public SimpleCollection()
public SimpleCollection(String label, CharSequence password)
label - The displayable label of the collection
NOTE: The 'label' of a collection may differ from the 'id' of a collection. The 'id' is assigned by the Secret Service and used in the DBus object path of a collection or item.
A SimpleCollection can't handle collections with the same label, but different ids correctly.
password - Password of the collectionpublic void clear()
public void close()
close in interface AutoCloseablepublic void delete()
throws AccessControlException
AccessControlExceptionpublic String createPassword(String label, CharSequence password, Map<String,String> attributes) throws IllegalArgumentException
label - The displayable label of the new itempassword - The password of the new itemattributes - The attributes of the new itemIllegalArgumentExceptionpublic String createPassword(String label, CharSequence password) throws IllegalArgumentException
label - The displayable label of the new itempassword - The password of the new itemIllegalArgumentExceptionpublic void updatePassword(String objectPath, String label, CharSequence password, Map<String,String> attributes) throws IllegalArgumentException
objectPath - The DBus object path of the itemlabel - The displayable label of the new itempassword - The password of the new itemattributes - The attributes of the new itemIllegalArgumentExceptionpublic String getLabel(String objectPath)
objectPath - The DBus object path of the itempublic Map<String,String> getAttributes(String objectPath)
The attributes can contain an additional 'xdg:schema' key-value pair.
objectPath - The DBus object path of the itempublic char[] getPassword(String objectPath)
objectPath - The DBus object path of the itempublic Map<String,char[]> getPasswords() throws AccessControlException
Retrieving all passwords form a collection requires user permission.
AccessControlExceptionpublic void deletePassword(String objectPath) throws AccessControlException
Deleting a password form a collection requires user permission.
objectPath - The DBus object path of the itemAccessControlExceptionpublic void deletePasswords(List<String> objectPaths) throws AccessControlException
Deleting passwords form a collection requires user permission.
objectPaths - The DBus object paths of the itemsAccessControlExceptionCopyright © 2019. All rights reserved.