Skip to content

Commit ba6ded5

Browse files
Update core/src/main/java/dev/vml/es/acm/core/repo/RepoResource.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent ce52ad7 commit ba6ded5

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

core/src/main/java/dev/vml/es/acm/core/repo/RepoResource.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -562,8 +562,13 @@ public RepoResource saveFile(Map<String, Object> properties, Consumer<OutputStre
562562
}
563563

564564
private void saveFileInternal(Map<String, Object> properties, InputStream data, Consumer<OutputStream> dataWriter) {
565-
if (properties == null || !properties.containsKey(JcrConstants.JCR_MIMETYPE)) {
566-
properties = Collections.singletonMap(JcrConstants.JCR_MIMETYPE, FILE_MIME_TYPE_DEFAULT);
565+
if (properties == null) {
566+
properties = new HashMap<>();
567+
}
568+
if (!properties.containsKey(JcrConstants.JCR_MIMETYPE)) {
569+
Map<String, Object> mutableProps = new HashMap<>(properties);
570+
mutableProps.put(JcrConstants.JCR_MIMETYPE, FILE_MIME_TYPE_DEFAULT);
571+
properties = mutableProps;
567572
}
568573

569574
Resource mainResource = resolve();

0 commit comments

Comments
 (0)