Skip to content

Commit 94419f2

Browse files
authored
Release 24.4 (#74)
* Add ScanBarcode endpoint * Version 24.4.0 * Fix @deprecated() warnings
1 parent 46aa4a0 commit 94419f2

File tree

95 files changed

+382
-2135
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+382
-2135
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Maven metadata URL](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Freleases.aspose.cloud%2Fjava%2Frepo%2Fcom%2Faspose%2Faspose-barcode-cloud%2Fmaven-metadata.xml)](https://releases.aspose.cloud/java/repo/com/aspose/aspose-barcode-cloud/)
66

77
- API version: 3.0
8-
- SDK version: 24.3.0
8+
- SDK version: 24.4.0
99

1010
## Demo applications
1111

@@ -68,7 +68,7 @@ Add this dependency to your project's POM:
6868
<dependency>
6969
<groupId>com.aspose</groupId>
7070
<artifactId>aspose-barcode-cloud</artifactId>
71-
<version>24.3.0</version>
71+
<version>24.4.0</version>
7272
<scope>compile</scope>
7373
</dependency>
7474
```
@@ -83,7 +83,7 @@ mvn clean package
8383

8484
Then manually install the following JARs:
8585

86-
- `target/aspose-barcode-cloud-24.3.0.jar`
86+
- `target/aspose-barcode-cloud-24.4.0.jar`
8787
- `target/lib/*.jar`
8888

8989
## Getting Started
@@ -130,6 +130,7 @@ public class BarcodeApiExample {
130130
String text = "Aspose.BarCode for Cloud Sample";
131131
GetBarcodeGenerateRequest request = new GetBarcodeGenerateRequest(type, text);
132132
request.textLocation = "None";
133+
133134
return api.getBarcodeGenerate(request);
134135
}
135136

@@ -169,6 +170,7 @@ Class | Method | HTTP request | Description
169170
*BarcodeApi* | [**putBarcodeGenerateFile**](docs/BarcodeApi.md#putBarcodeGenerateFile) | **PUT** /barcode/{name}/generate | Generate barcode and save on server (from query params or from file with json or xml content)
170171
*BarcodeApi* | [**putBarcodeRecognizeFromBody**](docs/BarcodeApi.md#putBarcodeRecognizeFromBody) | **PUT** /barcode/{name}/recognize | Recognition of a barcode from file on server with parameters in body.
171172
*BarcodeApi* | [**putGenerateMultiple**](docs/BarcodeApi.md#putGenerateMultiple) | **PUT** /barcode/{name}/generateMultiple | Generate image with multiple barcodes and put new file on server
173+
*BarcodeApi* | [**scanBarcode**](docs/BarcodeApi.md#scanBarcode) | **POST** /barcode/scan | Quickly scan a barcode from an image.
172174
*FileApi* | [**copyFile**](docs/FileApi.md#copyFile) | **PUT** /barcode/storage/file/copy/{srcPath} | Copy file
173175
*FileApi* | [**deleteFile**](docs/FileApi.md#deleteFile) | **DELETE** /barcode/storage/file/{path} | Delete file
174176
*FileApi* | [**downloadFile**](docs/FileApi.md#downloadFile) | **GET** /barcode/storage/file/{path} | Download file

docs/AustralianPostParams.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**encodingTable** | [**CustomerInformationInterpretingType**](CustomerInformationInterpretingType.md) | Interpreting type for the Customer Information of AustralianPost, default to CustomerInformationInterpretingType.Other\&quot; | [optional]
7+
**encodingTable** | [**CustomerInformationInterpretingType**](CustomerInformationInterpretingType.md) | Interpreting type for the Customer Information of AustralianPost, default to CustomerInformationInterpretingType.Other | [optional]
88
**shortBarHeight** | **Double** | Short bar&#39;s height of AustralianPost barcode. | [optional]
99

1010

docs/BarcodeApi.md

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Method | HTTP request | Description
1111
[**putBarcodeGenerateFile**](BarcodeApi.md#putBarcodeGenerateFile) | **PUT** /barcode/{name}/generate | Generate barcode and save on server (from query params or from file with json or xml content)
1212
[**putBarcodeRecognizeFromBody**](BarcodeApi.md#putBarcodeRecognizeFromBody) | **PUT** /barcode/{name}/recognize | Recognition of a barcode from file on server with parameters in body.
1313
[**putGenerateMultiple**](BarcodeApi.md#putGenerateMultiple) | **PUT** /barcode/{name}/generateMultiple | Generate image with multiple barcodes and put new file on server
14+
[**scanBarcode**](BarcodeApi.md#scanBarcode) | **POST** /barcode/scan | Quickly scan a barcode from an image.
1415

1516
## getBarcodeGenerate
1617

@@ -170,7 +171,7 @@ Name | Type | Description | Notes
170171
**allowAdditionalRestorations** | **Boolean**| Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. | [optional]
171172
**regionLikelihoodThresholdPercent** | **Double**| Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. | [optional]
172173
**scanWindowSizes** | **List&lt;Integer&gt;**| Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. | [optional]
173-
**similarity** | **Double**| Similarity coefficient depends on how homogeneous barcodes are. Use high value for for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] | [optional]
174+
**similarity** | **Double**| Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] | [optional]
174175
**skipDiagonalSearch** | **Boolean**| Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. | [optional]
175176
**readTinyBarcodes** | **Boolean**| Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. | [optional]
176177
**australianPostEncodingTable** | **String**| Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. | [optional] [enum: CTable, NTable, Other]
@@ -254,7 +255,7 @@ Name | Type | Description | Notes
254255
**allowAdditionalRestorations** | **Boolean**| Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. | [optional]
255256
**regionLikelihoodThresholdPercent** | **Double**| Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. | [optional]
256257
**scanWindowSizes** | **List&lt;Integer&gt;**| Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. | [optional]
257-
**similarity** | **Double**| Similarity coefficient depends on how homogeneous barcodes are. Use high value for for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] | [optional]
258+
**similarity** | **Double**| Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] | [optional]
258259
**skipDiagonalSearch** | **Boolean**| Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. | [optional]
259260
**readTinyBarcodes** | **Boolean**| Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. | [optional]
260261
**australianPostEncodingTable** | **String**| Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. | [optional] [enum: CTable, NTable, Other]
@@ -509,3 +510,53 @@ Name | Type | Description | Notes
509510

510511
[**ResultImageInfo**](ResultImageInfo.md)
511512

513+
## scanBarcode
514+
515+
> BarcodeResponseList scanBarcode(imageFile, decodeTypes, timeout)
516+
517+
Quickly scan a barcode from an image.
518+
519+
### scanBarcode example
520+
521+
```java
522+
// Import classes:
523+
import com.aspose.barcode.cloud.ApiClient;
524+
import com.aspose.barcode.cloud.ApiException;
525+
import com.aspose.barcode.cloud.Configuration;
526+
import com.aspose.barcode.cloud.auth.*;
527+
import com.aspose.barcode.cloud.api.BarcodeApi;
528+
529+
public class Main {
530+
531+
public static void main(String[] args) {
532+
533+
ApiClient client = new ApiClient(
534+
"Client Id from https://dashboard.aspose.cloud/applications",
535+
"Client Secret from https://dashboard.aspose.cloud/applications"
536+
);
537+
538+
BarcodeApi api = new BarcodeApi(client);
539+
File imageFile = new File("/path/to/file.txt"); // File | Image as file
540+
try {
541+
BarcodeResponseList result = api.scanBarcode(imageFile);
542+
System.out.println(result);
543+
} catch (ApiException e) {
544+
System.err.println("Exception when calling BarcodeApi.scanBarcode");
545+
e.printStackTrace();
546+
}
547+
}
548+
}
549+
```
550+
551+
### scanBarcode parameters
552+
553+
Name | Type | Description | Notes
554+
---- | ---- | ------------ | -----
555+
**imageFile** | **File**| Image as file |
556+
**decodeTypes** | [**List&lt;DecodeBarcodeType&gt;**](DecodeBarcodeType.md)| Types of barcode to recognize | [optional]
557+
**timeout** | **Integer**| Timeout of recognition process in milliseconds. Default value is 15_000 (15 seconds). Maximum value is 30_000 (1/2 minute). In case of a timeout RequestTimeout (408) status will be returned. Try reducing the image size to avoid timeout. | [optional]
558+
559+
### scanBarcode return type
560+
561+
[**BarcodeResponseList**](BarcodeResponseList.md)
562+

docs/ReaderParams.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Name | Type | Description | Notes
3535
**allowAdditionalRestorations** | **Boolean** | Allows engine using additional image restorations to recognize corrupted barcodes. At this time, it is used only in MicroPdf417 barcode type. Default value: False. | [optional]
3636
**regionLikelihoodThresholdPercent** | **Double** | Sets threshold for detected regions that may contain barcodes. Value 0.7 means that bottom 70% of possible regions are filtered out and not processed further. Region likelihood threshold must be between [0.05, 0.9] Use high values for clear images with few barcodes. Use low values for images with many barcodes or for noisy images. Low value may lead to a bigger recognition time. | [optional]
3737
**scanWindowSizes** | **List&lt;Integer&gt;** | Scan window sizes in pixels. Allowed sizes are 10, 15, 20, 25, 30. Scanning with small window size takes more time and provides more accuracy but may fail in detecting very big barcodes. Combining of several window sizes can improve detection quality. | [optional]
38-
**similarity** | **Double** | Similarity coefficient depends on how homogeneous barcodes are. Use high value for for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] | [optional]
38+
**similarity** | **Double** | Similarity coefficient depends on how homogeneous barcodes are. Use high value for clear barcodes. Use low values to detect barcodes that ara partly damaged or not lighten evenly. Similarity coefficient must be between [0.5, 0.9] | [optional]
3939
**skipDiagonalSearch** | **Boolean** | Allows detector to skip search for diagonal barcodes. Setting it to false will increase detection time but allow to find diagonal barcodes that can be missed otherwise. Enabling of diagonal search leads to a bigger detection time. | [optional]
4040
**readTinyBarcodes** | **Boolean** | Allows engine to recognize tiny barcodes on large images. Ignored if AllowIncorrectBarcodes is set to True. Default value: False. | [optional]
4141
**australianPostEncodingTable** | [**CustomerInformationInterpretingType**](CustomerInformationInterpretingType.md) | Interpreting Type for the Customer Information of AustralianPost BarCode.Default is CustomerInformationInterpretingType.Other. | [optional]

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>aspose-barcode-cloud</artifactId>
66
<packaging>jar</packaging>
77
<name>aspose-barcode-cloud</name>
8-
<version>24.3.0</version>
8+
<version>24.4.0</version>
99
<url>https://www.aspose.cloud</url>
1010
<description>Aspose.BarCode Cloud SDK for Java</description>
1111
<scm>

src/main/java/com/aspose/barcode/cloud/ApiClient.java

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
1-
// --------------------------------------------------------------------------------------------------------------------
2-
// <copyright company="Aspose">
3-
// Copyright (c) 2024 Aspose.BarCode for Cloud
4-
// </copyright>
5-
// <summary>
6-
// Permission is hereby granted, free of charge, to any person obtaining a copy
7-
// of this software and associated documentation files (the "Software"), to deal
8-
// in the Software without restriction, including without limitation the rights
9-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10-
// copies of the Software, and to permit persons to whom the Software is
11-
// furnished to do so, subject to the following conditions:
12-
//
13-
// The above copyright notice and this permission notice shall be included in all
14-
// copies or substantial portions of the Software.
15-
//
16-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22-
// SOFTWARE.
23-
// </summary>
24-
// --------------------------------------------------------------------------------------------------------------------
25-
261
package com.aspose.barcode.cloud;
272

283
import com.aspose.barcode.cloud.model.ApiErrorResponse;
@@ -66,7 +41,7 @@
6641
/** ApiClient. */
6742
public class ApiClient {
6843
public final String apiVersion = "v3.0";
69-
public final String clientVersion = "24.3.0";
44+
public final String clientVersion = "24.4.0";
7045

7146
private String baseUrl = "https://api.aspose.cloud";
7247
private String tokenUrl = baseUrl + "/connect/token";
@@ -110,7 +85,7 @@ protected ApiClient() {
11085
json = new JSON();
11186

11287
// Set default User-Agent.
113-
setUserAgent("Swagger-Codegen/24.3.0/java");
88+
setUserAgent("Swagger-Codegen/24.4.0/java");
11489

11590
addDefaultHeader("x-aspose-client", "java sdk");
11691
addDefaultHeader("x-aspose-client-version", clientVersion);
@@ -919,8 +894,9 @@ public RequestBody buildRequestBodyFormEncoding(Map<String, Object> formParams)
919894
public RequestBody buildRequestBodyMultipart(Map<String, Object> formParams) {
920895
MultipartBuilder mpBuilder = new MultipartBuilder().type(MultipartBuilder.FORM);
921896
for (Entry<String, Object> param : formParams.entrySet()) {
922-
if (param.getValue() instanceof File) {
923-
File file = (File) param.getValue();
897+
Object paramValue = param.getValue();
898+
if (paramValue instanceof File) {
899+
File file = (File) paramValue;
924900
Headers partHeaders =
925901
Headers.of(
926902
"Content-Disposition",
@@ -931,13 +907,23 @@ public RequestBody buildRequestBodyMultipart(Map<String, Object> formParams) {
931907
+ "\"");
932908
MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file));
933909
mpBuilder.addPart(partHeaders, RequestBody.create(mediaType, file));
910+
} else if (paramValue instanceof Collection) {
911+
Collection<Object> collection = (Collection<Object>) paramValue;
912+
for (Object item : collection) {
913+
Headers partHeaders =
914+
Headers.of(
915+
"Content-Disposition",
916+
"form-data; name=\"" + param.getKey() + "\"");
917+
mpBuilder.addPart(
918+
partHeaders, RequestBody.create(null, parameterToString(item)));
919+
}
934920
} else {
935921
Headers partHeaders =
936922
Headers.of(
937923
"Content-Disposition",
938924
"form-data; name=\"" + param.getKey() + "\"");
939925
mpBuilder.addPart(
940-
partHeaders, RequestBody.create(null, parameterToString(param.getValue())));
926+
partHeaders, RequestBody.create(null, parameterToString(paramValue)));
941927
}
942928
}
943929
return mpBuilder.build();

src/main/java/com/aspose/barcode/cloud/ApiException.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
1-
// --------------------------------------------------------------------------------------------------------------------
2-
// <copyright company="Aspose">
3-
// Copyright (c) 2024 Aspose.BarCode for Cloud
4-
// </copyright>
5-
// <summary>
6-
// Permission is hereby granted, free of charge, to any person obtaining a copy
7-
// of this software and associated documentation files (the "Software"), to deal
8-
// in the Software without restriction, including without limitation the rights
9-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10-
// copies of the Software, and to permit persons to whom the Software is
11-
// furnished to do so, subject to the following conditions:
12-
//
13-
// The above copyright notice and this permission notice shall be included in all
14-
// copies or substantial portions of the Software.
15-
//
16-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22-
// SOFTWARE.
23-
// </summary>
24-
// --------------------------------------------------------------------------------------------------------------------
25-
261
package com.aspose.barcode.cloud;
272

283
import com.aspose.barcode.cloud.model.ApiError;

src/main/java/com/aspose/barcode/cloud/Configuration.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,3 @@
1-
// --------------------------------------------------------------------------------------------------------------------
2-
// <copyright company="Aspose">
3-
// Copyright (c) 2024 Aspose.BarCode for Cloud
4-
// </copyright>
5-
// <summary>
6-
// Permission is hereby granted, free of charge, to any person obtaining a copy
7-
// of this software and associated documentation files (the "Software"), to deal
8-
// in the Software without restriction, including without limitation the rights
9-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10-
// copies of the Software, and to permit persons to whom the Software is
11-
// furnished to do so, subject to the following conditions:
12-
//
13-
// The above copyright notice and this permission notice shall be included in all
14-
// copies or substantial portions of the Software.
15-
//
16-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22-
// SOFTWARE.
23-
// </summary>
24-
// --------------------------------------------------------------------------------------------------------------------
25-
261
package com.aspose.barcode.cloud;
272

283
import java.io.File;

0 commit comments

Comments
 (0)