Class SecurePreferencesFactory
java.lang.Object
org.eclipse.equinox.security.storage.SecurePreferencesFactory
Use this class to access secure preferences. Secure preferences allow storage
of data in an encrypted form.
This class is not intended to be instantiated or extended by clients.
- Restriction:
- This class is not intended to be instantiated by clients.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ISecurePreferences
Returns default secure preferences.static ISecurePreferences
Returns a secure properties corresponding to the URL locations supplied.
-
Constructor Details
-
SecurePreferencesFactory
public SecurePreferencesFactory()
-
-
Method Details
-
getDefault
Returns default secure preferences.The framework will attempt to open secure preferences in a user-specific location. As a result, the information stored can be shared among all programs run by the user. The location is determined as follows:
- "-equinox.keyring" command line arguments
- Java's "user.home" environment variable. On Windows system it usually corresponds to the %USERPROFILE% environment variable or determined as the parent of user's desktop folder. On Unix Java usually determines it from user's entry in the password file (commonly this corresponds to $HOME environment variable);
- if it fails, preferences will use configuration location of the current Eclipse instance.
- Returns:
- default instance of secure preferences,
null
if application was unable to create secure preferences using default location
-
open
Returns a secure properties corresponding to the URL locations supplied. If URL isnull
, a default location is used.Note that while this method accepts URLs to account for future expandability of this API, at present the method only accepts "file" URLs that point to a directory. An
IOException
might be thrown if unsupported URL is passed to this method.Similarly to the rest of the Equinox, URLs passed as an argument must not be encoded, meaning that spaces should stay as spaces, not as "%x20".
- Parameters:
location
- URL pointing to the location of secure storage. At present only file URLs are supported. Passnull
to use default locationoptions
- use to pass hints to the secure preferences implementation. Passnull
if no options are needed. SeeIProviderHints
- Returns:
- a secure preferences
- Throws:
IOException
- if unsupported URLs types are passed in, or if location is not accessible
-