Skip to content

Commit 61f8268

Browse files
committed
Add Javadoc
1 parent c19cc78 commit 61f8268

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

src/main/java/org/purejava/Credentials.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
import java.io.*;
66
import java.util.Optional;
77

8-
// TODO Add Javadoc
8+
/**
9+
* This holds the associateId and the public key part of the idKey that together form the credentials needed to
10+
* access a KeePassXC database. Credentials is intended to be saved to and read from disc.
11+
*/
912
public class Credentials implements Serializable {
1013
private transient TweetNaclFast.Box.KeyPair ownKeypair;
1114
private byte[] secretKey;

src/main/java/org/purejava/KeepassProxyAccess.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,11 @@ public KeepassProxyAccess() {
5757
connection.setCredentials(loadCredentials());
5858
}
5959

60-
// TODO Add Javadoc
60+
/**
61+
* Loads the @see org.purejava.Credentials from disc, if available, to setup this library
62+
* so that it can be used to send requests to and receive requests from a KeePassXC database.
63+
* @return An Optional of the Credentials read from disc in case they are available, an empty Optional otherwise.
64+
*/
6165
private Optional<Credentials> loadCredentials() {
6266
try (FileInputStream fileIs = new FileInputStream(fileLocation);
6367
ObjectInputStream objIs = new ObjectInputStream(fileIs)) {
@@ -70,8 +74,11 @@ private Optional<Credentials> loadCredentials() {
7074
}
7175

7276

73-
74-
// TODO Add Javadoc
77+
/**
78+
* Saves @see org.purejava.Credentials in a delayed background thread to disc, as this is a time consuming
79+
* operation that might fail.
80+
* @param credentials An Optional of the Credentials to be saved.
81+
*/
7582
private void scheduleSave(Optional<Credentials> credentials) {
7683
if (credentials.isEmpty()) {
7784
log.debug("Credentials are not present and won't be saved");
@@ -85,7 +92,10 @@ private void scheduleSave(Optional<Credentials> credentials) {
8592
}
8693
}
8794

88-
// TODO Add Javadoc
95+
/**
96+
* Saves @see org.purejava.Credentials to disc.
97+
* @param credentials An Optional of the Credentials to be saved.
98+
*/
8999
private void saveCredentials(Optional<Credentials> credentials) {
90100
log.debug("Attempting to save credentials");
91101
try {

0 commit comments

Comments
 (0)