11package com .mindee ;
22
3- import com .fasterxml .jackson .databind .ObjectMapper ;
43import com .mindee .http .MindeeApiV2 ;
54import com .mindee .http .MindeeHttpApiV2 ;
65import com .mindee .http .MindeeHttpExceptionV2 ;
76import com .mindee .input .LocalInputSource ;
8- import com .mindee .input .LocalResponse ;
97import com .mindee .input .URLInputSource ;
108import com .mindee .parsing .v2 .ErrorResponse ;
119import com .mindee .parsing .v2 .InferenceResponse ;
1816public class MindeeClientV2 {
1917 private final MindeeApiV2 mindeeApi ;
2018
21- /** Uses an API- key read from the environment variables. */
19+ /** Uses an API key read from the environment variables. */
2220 public MindeeClientV2 () {
2321 this (createDefaultApiV2 ("" ));
2422 }
2523
26- /** Uses the supplied API- key. */
24+ /** Uses the supplied API key. */
2725 public MindeeClientV2 (String apiKey ) {
2826 this (createDefaultApiV2 (apiKey ));
2927 }
3028
3129
32- /** Inject both a PDF implementation and a HTTP implementation. */
30+ /** Inject both a PDF implementation and an HTTP implementation. */
3331 public MindeeClientV2 (MindeeApiV2 mindeeApi ) {
3432 this .mindeeApi = mindeeApi ;
3533 }
@@ -39,7 +37,8 @@ public MindeeClientV2(MindeeApiV2 mindeeApi) {
3937 */
4038 public JobResponse enqueueInference (
4139 LocalInputSource inputSource ,
42- InferenceParameters params ) throws IOException {
40+ InferenceParameters params
41+ ) throws IOException {
4342 return mindeeApi .reqPostInferenceEnqueue (inputSource , params );
4443 }
4544
@@ -49,7 +48,8 @@ public JobResponse enqueueInference(
4948 */
5049 public JobResponse enqueueInference (
5150 URLInputSource inputSource ,
52- InferenceParameters params ) throws IOException {
51+ InferenceParameters params
52+ ) throws IOException {
5353 return mindeeApi .reqPostInferenceEnqueue (inputSource , params );
5454 }
5555
@@ -72,7 +72,6 @@ public InferenceResponse getInference(String inferenceId) {
7272 if (inferenceId == null || inferenceId .trim ().isEmpty ()) {
7373 throw new IllegalArgumentException ("inferenceId must not be null or blank." );
7474 }
75-
7675 return mindeeApi .reqGetInference (inferenceId );
7776 }
7877
@@ -86,8 +85,8 @@ public InferenceResponse getInference(String inferenceId) {
8685 */
8786 public InferenceResponse enqueueAndGetInference (
8887 LocalInputSource inputSource ,
89- InferenceParameters options ) throws IOException , InterruptedException {
90-
88+ InferenceParameters options
89+ ) throws IOException , InterruptedException {
9190 validatePollingOptions (options .getPollingOptions ());
9291 JobResponse job = enqueueInference (inputSource , options );
9392 return pollAndFetch (job , options );
@@ -105,8 +104,8 @@ public InferenceResponse enqueueAndGetInference(
105104 */
106105 public InferenceResponse enqueueAndGetInference (
107106 URLInputSource inputSource ,
108- InferenceParameters options ) throws IOException , InterruptedException {
109-
107+ InferenceParameters options
108+ ) throws IOException , InterruptedException {
110109 validatePollingOptions (options .getPollingOptions ());
111110 JobResponse job = enqueueInference (inputSource , options );
112111 return pollAndFetch (job , options );
@@ -119,8 +118,10 @@ public InferenceResponse enqueueAndGetInference(
119118 * @return an instance of {@link InferenceResponse}.
120119 * @throws InterruptedException Throws if interrupted.
121120 */
122- private InferenceResponse pollAndFetch (JobResponse initialJob ,
123- InferenceParameters options ) throws InterruptedException {
121+ private InferenceResponse pollAndFetch (
122+ JobResponse initialJob ,
123+ InferenceParameters options
124+ ) throws InterruptedException {
124125 Thread .sleep ((long ) (options .getPollingOptions ().getInitialDelaySec () * 1000 ));
125126
126127 JobResponse resp = initialJob ;
0 commit comments