From ad6f20eece4f5441a50a4121c82ccfb388a933b3 Mon Sep 17 00:00:00 2001 From: Vikram Kalta Date: Wed, 20 Mar 2024 22:05:41 +0000 Subject: [PATCH 1/5] fix: fixed null content type issue --- .../java/com/contentstack/cms/stack/FileUploader.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/contentstack/cms/stack/FileUploader.java b/src/main/java/com/contentstack/cms/stack/FileUploader.java index df0f6d16..8b28c150 100644 --- a/src/main/java/com/contentstack/cms/stack/FileUploader.java +++ b/src/main/java/com/contentstack/cms/stack/FileUploader.java @@ -6,9 +6,11 @@ import java.io.File; import java.io.IOException; -import java.nio.file.Files; +import java.nio.file.Paths; import java.util.Objects; +import javax.activation.MimetypesFileTypeMap; + public class FileUploader { @@ -49,7 +51,9 @@ private void addFormDataPartIfNotNull(MultipartBody.Builder builder, String name // Helper method to get content type of file private String getContentType(File file) { try { - return Files.probeContentType(file.toPath()); + java.nio.file.Path source = Paths.get(file.toString()); + MimetypesFileTypeMap m = new MimetypesFileTypeMap(source.toString()); + return m.getContentType(file); } catch (IOException e) { throw new RuntimeException("Failed to determine content type of file", e); } From 91f188d6bbb85b39519de1e65ae9116f8e9d65a3 Mon Sep 17 00:00:00 2001 From: Vikram Kalta Date: Thu, 21 Mar 2024 21:43:34 +0000 Subject: [PATCH 2/5] fix: bumped version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 17bbc160..5ec3531c 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ cms jar contentstack-management-java - 1.3.1 + 1.3.2 Contentstack Java Management SDK for Content Management API, Contentstack is a headless CMS with an API-first approach From 4fd4e58d5685e8921b99f882d0ac3b8135b6dd0b Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Tue, 26 Mar 2024 16:42:32 +0530 Subject: [PATCH 3/5] fix: added missing dependency to pom.xml --- pom.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5ec3531c..9ed6e771 100644 --- a/pom.xml +++ b/pom.xml @@ -177,7 +177,11 @@ 1.1.1 compile - + + javax.activation + activation + 1.1.1 + From 1e9d25476d0d7077c641d2c6718f209a8f42dbc8 Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Wed, 27 Mar 2024 18:23:41 +0530 Subject: [PATCH 4/5] fix: removed the staging documentation links --- src/main/java/com/contentstack/cms/stack/Merge.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/contentstack/cms/stack/Merge.java b/src/main/java/com/contentstack/cms/stack/Merge.java index e95f7272..7632340c 100644 --- a/src/main/java/com/contentstack/cms/stack/Merge.java +++ b/src/main/java/com/contentstack/cms/stack/Merge.java @@ -41,7 +41,7 @@ * @author ***REMOVED*** * @version v1.0.0 * @see Merge + * "https://www.contentstack.com/docs/developers/apis/content-management-api/#merge-branches">Merge * Branches * @since 2023 -June-30 */ @@ -128,7 +128,7 @@ public Call branch(@NotNull String compareBranch, JSONObject reque * * @return the call * @see Get + * "https://www.contentstack.com/docs/developers/apis/content-management-api/#get-all-merge-jobs">Get * all * Merge Jobs */ @@ -144,7 +144,7 @@ public Call find() { * @param mergeJobUid the key of the header to be added * @return the call * @see Get + * "https://www.contentstack.com/docs/developers/apis/content-management-api/#get-single-merge-job">Get * a * Single Merge Job */ From 15439642a1a68ca44b496b5b5ebe190858cf710d Mon Sep 17 00:00:00 2001 From: Abhinav Gupta Date: Thu, 28 Mar 2024 16:20:23 +0530 Subject: [PATCH 5/5] chore: updated changelog.md --- changelog.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/changelog.md b/changelog.md index b21da333..42a19a6b 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## v1.3.2 + +### March 28, 2024 + +- Fix: + - fixed null content type issue + ## v1.3.1 ### Feb 22, 2024