Skip to content

Commit 0e26fb7

Browse files
authored
Fix Javadoc warnings by adding missing @param, @return and @throws tags (#46)
1 parent 56117ae commit 0e26fb7

File tree

5 files changed

+50
-1
lines changed

5 files changed

+50
-1
lines changed

src/main/java/com/didww/sdk/DidwwClient.java

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,13 @@ public Repository<RequirementValidation> requirementValidations() {
194194

195195
/**
196196
* Uploads one encrypted file to /encrypted_files as multipart/form-data.
197-
* Returns encrypted file IDs provided by API response.
197+
*
198+
* @param encryptedData encrypted file bytes to upload
199+
* @param fileName original file name sent as the multipart part name
200+
* @param fingerprint encryption key fingerprint identifying the public key used
201+
* @param description optional human-readable description for the file (may be {@code null})
202+
* @return list of encrypted file IDs returned by the API
203+
* @throws DidwwClientException if the upload fails or the response is unexpected
198204
*/
199205
public List<String> uploadEncryptedFile(byte[] encryptedData,
200206
String fileName,
@@ -257,6 +263,10 @@ public List<String> uploadEncryptedFile(byte[] encryptedData,
257263

258264
/**
259265
* Downloads an export file to the given path.
266+
*
267+
* @param url URL of the export file to download
268+
* @param destination local path where the file will be written
269+
* @throws DidwwClientException if the download fails or the response body is empty
260270
*/
261271
public void downloadExport(String url, Path destination) {
262272
Request request = new Request.Builder().url(url).get().build();
@@ -278,6 +288,10 @@ public void downloadExport(String url, Path destination) {
278288

279289
/**
280290
* Downloads a gzip-compressed export file (.csv.gz) and writes the decompressed CSV to the given path.
291+
*
292+
* @param url URL of the gzip-compressed export file to download
293+
* @param destination local path where the decompressed CSV will be written
294+
* @throws DidwwClientException if the download or decompression fails
281295
*/
282296
public void downloadAndDecompressExport(String url, Path destination) {
283297
Path tempFile;
@@ -342,6 +356,9 @@ public Builder readTimeout(Duration readTimeout) {
342356

343357
/**
344358
* Overrides the base URL from the credentials environment. Useful for testing.
359+
*
360+
* @param baseUrl base URL to use instead of the environment default
361+
* @return this builder
345362
*/
346363
public Builder baseUrl(String baseUrl) {
347364
this.baseUrl = baseUrl;
@@ -351,6 +368,9 @@ public Builder baseUrl(String baseUrl) {
351368
/**
352369
* Sets a custom OkHttpClient.Builder for advanced configuration such as proxy,
353370
* SSL, interceptors, etc. The API key interceptor will be added automatically.
371+
*
372+
* @param httpClientBuilder custom OkHttpClient builder to use as the base
373+
* @return this builder
354374
*/
355375
public Builder httpClientBuilder(OkHttpClient.Builder httpClientBuilder) {
356376
this.httpClientBuilder = httpClientBuilder;

src/main/java/com/didww/sdk/SdkVersion.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,17 @@ private SdkVersion() {
4040
/**
4141
* Returns the SDK version string (e.g. {@code "1.0.0"}).
4242
* Falls back to {@code "unknown"} when the properties file is absent.
43+
*
44+
* @return SDK version string
4345
*/
4446
public static String get() {
4547
return VERSION;
4648
}
4749

4850
/**
4951
* Returns the full User-Agent value, e.g. {@code "didww-java-sdk/1.0.0"}.
52+
*
53+
* @return User-Agent header value
5054
*/
5155
public static String userAgent() {
5256
return "didww-java-sdk/" + VERSION;

src/main/java/com/didww/sdk/exception/DidwwApiException.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ public static class ApiError {
7777
/**
7878
* Returns {@code detail} if present, otherwise falls back to {@code title},
7979
* or {@code "Unknown error"} when both are absent.
80+
*
81+
* @return human-readable error message
8082
*/
8183
@JsonIgnore
8284
public String getMessage() {

src/main/java/com/didww/sdk/http/ApiKeyInterceptor.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ public ApiKeyInterceptor(String apiKey) {
1616
this.apiKey = apiKey;
1717
}
1818

19+
/**
20+
* Adds authentication and versioning headers to every outgoing request.
21+
*
22+
* @param chain OkHttp interceptor chain
23+
* @return response from the next interceptor or the network
24+
* @throws IOException if the request could not be executed
25+
*/
1926
@Override
2027
public Response intercept(Chain chain) throws IOException {
2128
Request original = chain.request();

src/main/java/com/didww/sdk/repository/ReadOnlyRepository.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ public ApiResponse<T> find(String id, QueryParams params) {
8484
}
8585
}
8686

87+
/**
88+
* Throws {@link DidwwApiException} when the response status is not successful,
89+
* parsing API error objects from the response body when available.
90+
*
91+
* @param response OkHttp response to inspect
92+
* @throws IOException if the response body cannot be read
93+
* @throws DidwwApiException if the response indicates an API error
94+
*/
8795
protected void handleErrorResponse(Response response) throws IOException {
8896
if (!response.isSuccessful()) {
8997
String body = response.body() != null ? response.body().string() : "";
@@ -107,6 +115,14 @@ protected void handleErrorResponse(Response response) throws IOException {
107115
}
108116
}
109117

118+
/**
119+
* Returns the response body as a byte array.
120+
*
121+
* @param response OkHttp response whose body will be consumed
122+
* @return response body bytes
123+
* @throws IOException if the body cannot be read
124+
* @throws DidwwClientException if the response body is absent
125+
*/
110126
protected byte[] getResponseBody(Response response) throws IOException {
111127
ResponseBody body = response.body();
112128
if (body == null) {

0 commit comments

Comments
 (0)