Repository navigation
·
5 commits
to v3-master
since this release
A release of version 3 with two breaking changes, made early while version 3 has few users: it needs Java 17, and times are java.time.Instant. It also adds read and write, which leave your streams open. It is on Maven Central.
Version 2 is still maintained for now, with bug and security fixes; its current release is 2.2.6, on the master branch. Version 3 is developed on v3-develop, and v3-master holds the latest 3.x release.
Changes you may need to act on
Upgrading from 3.0.0:
- Java 17 is required (3.0.0 needed Java 11).
- Times are
Instant(#111).getCreationTime(),getLastModificationTime(),getLastAccessTime()andgetExpiryTime()onEntryandGroupreturnjava.time.Instant, andsetExpiryTime(...)takes one. Where you need aDate, convert at the call:The times stored in files are unchanged.Date created = Date.from(entry.getCreationTime()); entry.setExpiryTime(expiryDate.toInstant());
Helpers.toDate/fromDateare nowtoInstant/fromInstant. saveandloadare deprecated (#109). They close the stream they're given, which you may not expect. Usewriteandread, which leave it open, and close it yourself:try (InputStream inputStream = Files.newInputStream(path)) { database = KdbxDatabase.read(credentials, inputStream); }
saveandloadstill work, and still close the stream.loadXmlis replaced byreadXml, which throwsIOExceptionrather thanException, and thesaveNx/loadNxmethods are deprecated too.Util.listDatabaseno longer closes the output stream it's given.
The readme has upgrade notes, for 3.0 to 3.1 and for 2.x to 3.0.
New
readandwritethat leave the stream open (#109):Database.write,KdbxDatabase.read,KdbxDatabase.readXmlandKdbDatabase.read, andread/writeonStreamFormat,SerializableDatabaseandBasicDatabaseSerializer. Existing implementations of those interfaces get them as default methods, so they keep working.
Other changes
- The examples, tests and readme use
read/writewith try-with-resources. - The
getPassword/setPasswordimplementations are marked deprecated, like theEntrymethods they implement; the KDB reader no longer uses them, and they're tested. - Jackson's deprecated
setSerializationInclusionis replaced bysetDefaultPropertyInclusion, which does the same.
Maven
<dependency>
<groupId>org.linguafranca.pwdb</groupId>
<artifactId>KeePassJava2.kdbx.database</artifactId>
<version>3.1.0</version>
</dependency>Or KeePassJava2 for the KDBX and KDB implementations together.
See the CHANGELOG for the full history.