diff --git a/NOTICE.txt b/NOTICE.txt new file mode 100644 index 0000000..bef24aa --- /dev/null +++ b/NOTICE.txt @@ -0,0 +1,3 @@ +IDRSolutions Java Client + +Copyright 2021 - 2023 IDRsolutions diff --git a/README.md b/README.md index e239a80..56a6476 100644 --- a/README.md +++ b/README.md @@ -42,8 +42,6 @@ Got questions? You can contact us [here](https://idrsolutions.atlassian.net/serv ----- -Copyright 2021 IDRsolutions - Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at diff --git a/pom.xml b/pom.xml index 50dcb38..e2bca50 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.idrsolutions idrsolutions-java-client jar - 1.0.0 + 2.0.0 IDRsolutions Java Client @@ -29,4 +29,4 @@ - \ No newline at end of file + diff --git a/src/main/java/idrsolutions/ClientException.java b/src/main/java/idrsolutions/ClientException.java index 9bf779e..4b44931 100644 --- a/src/main/java/idrsolutions/ClientException.java +++ b/src/main/java/idrsolutions/ClientException.java @@ -1,3 +1,19 @@ +/** + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + **/ package idrsolutions; public class ClientException extends Exception { diff --git a/src/main/java/idrsolutions/ExampleUsage.java b/src/main/java/idrsolutions/ExampleUsage.java index e46ceb6..b72e8f0 100644 --- a/src/main/java/idrsolutions/ExampleUsage.java +++ b/src/main/java/idrsolutions/ExampleUsage.java @@ -1,3 +1,19 @@ +/** + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + **/ package idrsolutions; @@ -37,6 +53,7 @@ public static void main(final String[] args) { IDRCloudClient.downloadResults(results, "path/to/outputDir", "example"); } catch (final ClientException | InterruptedException e) { e.printStackTrace(); + Thread.currentThread().interrupt(); } } } \ No newline at end of file diff --git a/src/main/java/idrsolutions/IDRCloudClient.java b/src/main/java/idrsolutions/IDRCloudClient.java index 7c9acfe..cb674ee 100644 --- a/src/main/java/idrsolutions/IDRCloudClient.java +++ b/src/main/java/idrsolutions/IDRCloudClient.java @@ -1,3 +1,23 @@ +/** + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Used to interact with IDRsolutions' Microservice examples + * For detailed usage instructions, see the GitHub repository: + * https://github.com/idrsolutions/idrsolutions-java-client + * + **/ package idrsolutions; import com.google.gson.Gson; @@ -14,24 +34,6 @@ import java.util.Iterator; import java.util.Map; -/** - * Copyright 2021 IDRsolutions - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * Main class used to interact with IDRsolutions' Microservice examples - * For detailed usage instructions, see the GitHub repository: - * https://github.com/idrsolutions/idrsolutions-java-client - * - * Used to interact with IDRsolutions' Microservice examples - * - **/ public class IDRCloudClient { public static final String DOWNLOAD = "download"; public static final String UPLOAD = "upload"; @@ -46,20 +48,20 @@ public class IDRCloudClient { /** * Constructor, setup the converter details * - * @param url + * @param url The URL of Microservice to connect to. */ public IDRCloudClient(final String url) { endPoint = url; requestTimeout = 60000; - conversionTimeout = 30; + conversionTimeout = -1; } /** * Constructor with timeout, setup the converter details * - * @param url - * @param requestTimeout - * @param conversionTimeout + * @param url The URL of Microservice to connect to. + * @param requestTimeout The time to wait (in milliseconds) before timing out each request. Set to 60000ms (60s) by default. + * @param conversionTimeout The time to wait (in seconds) before timing out the conversion. If value <= 0 then the conversion does not time out. Set to -1 by default. */ public IDRCloudClient(final String url, final int requestTimeout, final int conversionTimeout) { endPoint = url; @@ -107,7 +109,7 @@ public Map convert(final Map parameters) throws break; } - if (i >= conversionTimeout) { + if (conversionTimeout > 0 && i >= conversionTimeout) { throw new ClientException("Failed: File took longer than " + conversionTimeout + " seconds to convert."); }