Search in sources :

Example 1 with KeePassDatabase

use of de.slackspace.openkeepass.KeePassDatabase in project TinyKeePass by sorz.

the class OpenKeePassTask method doInBackground.

@Override
protected KeePassFile doInBackground(Void... voids) {
    try {
        long t = System.currentTimeMillis();
        KeePassDatabase instance = KeePassDatabase.getInstance(path);
        Log.d(TAG, "get instance in " + (System.currentTimeMillis() - t) + "ms");
        t = System.currentTimeMillis();
        KeePassFile keePassFile = instance.openDatabase(key);
        Log.d(TAG, "open db in " + (System.currentTimeMillis() - t) + "ms");
        return keePassFile;
    } catch (KeePassDatabaseUnreadableException | UnsupportedOperationException e) {
        Log.w(TAG, "cannot open database.", e);
        errorMessage = e.getLocalizedMessage();
    }
    return null;
}
Also used : KeePassDatabase(de.slackspace.openkeepass.KeePassDatabase) KeePassDatabaseUnreadableException(de.slackspace.openkeepass.exception.KeePassDatabaseUnreadableException) KeePassFile(de.slackspace.openkeepass.domain.KeePassFile)

Aggregations

KeePassDatabase (de.slackspace.openkeepass.KeePassDatabase)1 KeePassFile (de.slackspace.openkeepass.domain.KeePassFile)1 KeePassDatabaseUnreadableException (de.slackspace.openkeepass.exception.KeePassDatabaseUnreadableException)1