@@ -29,17 +29,17 @@ public class LocalResponse {
2929
3030 /**
3131 * Load from an {@link InputStream}.
32+ *
3233 * @param input will be decoded as UTF-8.
3334 */
3435 public LocalResponse (InputStream input ) {
35- this .file = this .getBytes (
36- new BufferedReader (new InputStreamReader (input , StandardCharsets .UTF_8 ))
37- .lines ()
38- );
36+ this .file = this
37+ .getBytes (new BufferedReader (new InputStreamReader (input , StandardCharsets .UTF_8 )).lines ());
3938 }
4039
4140 /**
4241 * Load from a {@link String}.
42+ *
4343 * @param input will be decoded as UTF-8.
4444 */
4545 public LocalResponse (String input ) {
@@ -48,22 +48,20 @@ public LocalResponse(String input) {
4848
4949 /**
5050 * Load from a {@link File}.
51+ *
5152 * @param input will be decoded as UTF-8.
5253 */
5354 public LocalResponse (File input ) throws IOException {
54- this .file = this .getBytes (
55- Files .lines (input .toPath (), StandardCharsets .UTF_8 )
56- );
55+ this .file = this .getBytes (Files .lines (input .toPath (), StandardCharsets .UTF_8 ));
5756 }
5857
5958 /**
6059 * Load from a {@link Path}.
60+ *
6161 * @param input will be decoded as UTF-8.
6262 */
6363 public LocalResponse (Path input ) throws IOException {
64- this .file = this .getBytes (
65- Files .lines (input , StandardCharsets .UTF_8 )
66- );
64+ this .file = this .getBytes (Files .lines (input , StandardCharsets .UTF_8 ));
6765 }
6866
6967 private byte [] getBytes (Stream <String > stream ) {
@@ -72,6 +70,7 @@ private byte[] getBytes(Stream<String> stream) {
7270
7371 /**
7472 * Get the HMAC signature of the payload.
73+ *
7574 * @param secretKey Your secret key from the Mindee platform.
7675 * @return The generated HMAC signature.
7776 */
@@ -98,6 +97,7 @@ public String getHmacSignature(String secretKey) {
9897
9998 /**
10099 * Verify that the payload's signature matches the one received from the server.
100+ *
101101 * @param secretKey Your secret key from the Mindee platform.
102102 * @param signature The signature from the "X-Mindee-Hmac-Signature" HTTP header.
103103 * @return true if the signatures match.
@@ -106,13 +106,12 @@ public boolean isValidHmacSignature(String secretKey, String signature) {
106106 return signature .equals (getHmacSignature (secretKey ));
107107 }
108108
109-
110109 /**
111110 * Deserialize this local JSON payload into a specific {@link CommonResponse}
112111 * subtype: {@code InferenceResponse}, {@code JobResponse}.
113112 *
114113 * @param responseClass the concrete class to instantiate
115- * @param <T> generic {@link CommonResponse}
114+ * @param <T> generic {@link CommonResponse}
116115 * @return Either a {@code InferenceResponse} or {@code JobResponse} instance.
117116 * @throws MindeeException if the payload cannot be deserialized into the requested type
118117 */
0 commit comments