Skip to content

Commit eb77908

Browse files
[TASKSCLOUD-945] - Deployed new 25.10 version.
1 parent f7f0fd9 commit eb77908

File tree

5 files changed

+81
-32
lines changed

5 files changed

+81
-32
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ Add this dependency to your project's POM:
9191
<dependency>
9292
<groupId>com.aspose</groupId>
9393
<artifactId>aspose-tasks-cloud</artifactId>
94-
<version>25.8.0</version>
94+
<version>25.10.0</version>
9595
</dependency>
9696
</dependencies>
9797
```

aspose-tasks-cloud-25.8.0.pom renamed to aspose-tasks-cloud-25.10.0.pom

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<artifactId>aspose-tasks-cloud</artifactId>
55
<packaging>jar</packaging>
66
<name>aspose-tasks-cloud</name>
7-
<version>25.8.0</version>
7+
<version>25.10.0</version>
88
<url>https://www.aspose.cloud/</url>
99
<description>Aspose Tasks Cloud Java SDK</description>
1010
<scm>
@@ -303,8 +303,8 @@
303303
<gson-fire-version>1.8.0</gson-fire-version>
304304
<swagger-core-version>1.5.18</swagger-core-version>
305305
<okhttp-version>2.7.5</okhttp-version>
306-
<gson-version>2.8.1</gson-version>
307-
<threetenbp-version>1.3.5</threetenbp-version>
306+
<gson-version>2.8.9</gson-version>
307+
<threetenbp-version>1.3.5</threetenbp-version>
308308
<maven-plugin-version>1.0.0</maven-plugin-version>
309309
<junit-version>4.12</junit-version>
310310
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<artifactId>aspose-tasks-cloud</artifactId>
55
<packaging>jar</packaging>
66
<name>aspose-tasks-cloud</name>
7-
<version>25.8.0</version>
7+
<version>25.10.0</version>
88
<url>https://www.aspose.cloud/</url>
99
<description>Aspose Tasks Cloud Java SDK</description>
1010
<scm>
@@ -303,8 +303,8 @@
303303
<gson-fire-version>1.8.0</gson-fire-version>
304304
<swagger-core-version>1.5.18</swagger-core-version>
305305
<okhttp-version>2.7.5</okhttp-version>
306-
<gson-version>2.8.1</gson-version>
307-
<threetenbp-version>1.3.5</threetenbp-version>
306+
<gson-version>2.8.9</gson-version>
307+
<threetenbp-version>1.3.5</threetenbp-version>
308308
<maven-plugin-version>1.0.0</maven-plugin-version>
309309
<junit-version>4.12</junit-version>
310310
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public class ApiClient {
7070
private String baseUrl = "https://api.aspose.cloud";
7171
private String authUrl = "";
7272
private String basePath = baseUrl + "/" + apiVersion;
73-
private String clientVersion = "25.8.0";
73+
private String clientVersion = "25.10.0";
7474
private boolean debugging = false;
7575
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
7676
private String tempFolderPath = null;

src/main/java/com/aspose/tasks/cloud/JSON.java

Lines changed: 73 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929

3030
import com.aspose.tasks.cloud.model.*;
3131
import com.aspose.tasks.cloud.model.responses.*;
32+
import org.threeten.bp.LocalDateTime;
33+
import org.threeten.bp.format.DateTimeParseException;
3234
import com.google.gson.*;
3335
import com.google.gson.internal.bind.util.ISO8601Utils;
3436
import com.google.gson.stream.JsonReader;
@@ -312,33 +314,80 @@ public OffsetDateTime read(JsonReader in) throws IOException {
312314
return null;
313315
default:
314316
String date = in.nextString();
315-
if (date.endsWith("Z")) {
316-
date = date.substring(0, date.length() - 1);
317-
}
318-
if (date.indexOf("+") >= 0) {
319-
date = date.substring(0, date.indexOf("+"));
320-
}
321-
Integer index = date.indexOf("T");
322-
String dateString = date.substring(0, index);
323-
String[] timeString = date.substring(index + 1).split(":");
324-
String[] val = dateString.split("-");
325-
String second = timeString[2];
326-
Integer nanoOfSecond = 0;
327-
if(second.contains(".")) {
328-
String[] separatedValues = second.split("\\.");
329-
second = separatedValues[0];
330-
nanoOfSecond = Integer.valueOf(separatedValues[1]);
317+
try {
318+
return OffsetDateTime.parse(date, formatter);
319+
} catch (DateTimeParseException e1) {
320+
try {
321+
return OffsetDateTime.parse(date);
322+
} catch (DateTimeParseException e2) {
323+
try {
324+
LocalDateTime ldt = LocalDateTime.parse(date, DateTimeFormatter.ISO_LOCAL_DATE_TIME);
325+
return OffsetDateTime.of(ldt, ZoneOffset.UTC);
326+
} catch (DateTimeParseException e3) {
327+
String normalized = normalizeOffsetDateTimeString(date);
328+
try {
329+
return OffsetDateTime.parse(normalized, formatter);
330+
} catch (DateTimeParseException e4) {
331+
try {
332+
return OffsetDateTime.parse(normalized);
333+
} catch (DateTimeParseException e5) {
334+
LocalDateTime ldt2 = LocalDateTime.parse(normalized, DateTimeFormatter.ISO_LOCAL_DATE_TIME);
335+
return OffsetDateTime.of(ldt2, ZoneOffset.UTC);
336+
}
337+
}
338+
}
339+
}
331340
}
332-
return OffsetDateTime.of(Integer.valueOf(val[0]),
333-
Integer.valueOf(val[1]),
334-
Integer.valueOf(val[2]),
335-
Integer.valueOf(timeString[0]),
336-
Integer.valueOf(timeString[1]),
337-
Integer.valueOf(second),
338-
nanoOfSecond,
339-
ZoneOffset.UTC);
340341
}
341342
}
343+
344+
private static String normalizeOffsetDateTimeString(String input) {
345+
int tIndex = input.indexOf('T');
346+
if (tIndex < 0) return input;
347+
348+
int plus = input.indexOf('+', tIndex);
349+
int minus = input.indexOf('-', tIndex);
350+
int tzPos;
351+
if (plus == -1 && minus == -1) {
352+
tzPos = -1;
353+
} else if (plus == -1) {
354+
tzPos = minus;
355+
} else if (minus == -1) {
356+
tzPos = plus;
357+
} else {
358+
tzPos = Math.min(plus, minus);
359+
}
360+
361+
String main;
362+
String offset = "";
363+
if (tzPos >= 0) {
364+
main = input.substring(0, tzPos);
365+
offset = input.substring(tzPos);
366+
} else {
367+
main = input;
368+
}
369+
370+
if (main.contains(".")) {
371+
int dot = main.indexOf('.');
372+
String before = main.substring(0, dot);
373+
String fraction = main.substring(dot + 1);
374+
fraction = fraction.replaceAll("[^0-9]", "");
375+
if (fraction.length() > 9) fraction = fraction.substring(0, 9);
376+
while (fraction.length() < 9) fraction = fraction + "0";
377+
main = before + "." + fraction;
378+
}
379+
380+
if (!offset.isEmpty()) {
381+
if (offset.matches("^[+-]\\d{2}$")) {
382+
offset = offset + ":00";
383+
}
384+
else if (offset.matches("^[+-]\\d{4}$")) {
385+
offset = offset.substring(0, 3) + ":" + offset.substring(3);
386+
}
387+
}
388+
389+
return main + offset;
390+
}
342391
}
343392

344393
/**

0 commit comments

Comments
 (0)