Class CredentialStoreFactory

  extended by

public class CredentialStoreFactory
extends java.lang.Object

Factory class providing instances of a {linkplain CredentialStore credential store}.

If the file backing a credential store does not already exist, it is created on the first call to CredentialStore.addPassword(java.lang.String, java.lang.String, char[]). If the default file is being used, its directory will also be created if necessary.

Each method of the returned credential store acquires a lock on the store for the duration of the method call, blocking if necessary to do so. The implementation may time out (throwing IOException) if the lock cannot be acquired within a reasonable amount of time, on the order of a minute. Locks are acquired on behalf of the entire Java virtual machine, not just the current thread.

The methods in this class may be invoked concurrently by multiple threads.

Constructor Summary
Method Summary
static CredentialStore getCredentialStore()
          Returns the default credential store.
static CredentialStore getCredentialStore( file)
          Returns a credential store given the file backing it.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public CredentialStoreFactory()
Method Detail


public static CredentialStore getCredentialStore()
Returns the default credential store.



public static CredentialStore getCredentialStore( file)
Returns a credential store given the file backing it.

file - the file to use, or null to use the default
the credential store for the specified file