Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9ca9f48
fixed mime type validation error
deepikaSingh2711 Sep 2, 2025
2cf3db8
fixed mime type error logic
deepikaSingh2711 Sep 3, 2025
9795dde
formatting correction
deepikaSingh2711 Sep 3, 2025
0169460
UT's and IT's
deepikaSingh2711 Sep 8, 2025
a1f58ef
Merge branch 'develop' into mimetype
rashmiangadi05 Sep 9, 2025
afc9f49
updated message constant
deepikaSingh2711 Sep 9, 2025
01498f3
Merge branch 'mimetype' of https://github.com/cap-java/sdm into mimetype
deepikaSingh2711 Sep 9, 2025
986a152
Merge remote-tracking branch 'origin/createLinkTests' into mimetype
deepikaSingh2711 Sep 13, 2025
dac6b46
Update pom.xml
deepikaSingh2711 Sep 23, 2025
78ef733
Update pom.xml
deepikaSingh2711 Sep 23, 2025
919c8cb
Update pom.xml
deepikaSingh2711 Sep 23, 2025
a360d9d
Merge branch 'develop' into mimetype
deepikaSingh2711 Sep 25, 2025
4781ef8
fix (#324)
rishikunnath2747 Sep 25, 2025
c98239c
Merge branch 'mimetype' of https://github.com/cap-java/sdm into mimetype
deepikaSingh2711 Sep 25, 2025
60e155e
resolved conflicts
deepikaSingh2711 Sep 25, 2025
3174acf
indentation correction
deepikaSingh2711 Sep 25, 2025
164430f
fix
deepikaSingh2711 Sep 25, 2025
bb41e27
Update pom.xml
deepikaSingh2711 Sep 26, 2025
3526ee0
change
deepikaSingh2711 Sep 26, 2025
9a31c22
Merge branch 'mimetype' of https://github.com/cap-java/sdm into mimetype
deepikaSingh2711 Sep 26, 2025
3ac6fe5
update message constant
deepikaSingh2711 Sep 28, 2025
8049884
Update pom.xml
deepikaSingh2711 Sep 28, 2025
23711b0
Update pom.xml
deepikaSingh2711 Sep 29, 2025
afdc15d
IT fix
deepikaSingh2711 Sep 29, 2025
a9d75e0
Merge branch 'mimetype' of https://github.com/cap-java/sdm into mimetype
deepikaSingh2711 Sep 29, 2025
27ad5eb
Merge branch 'Release_v1.6.0' into mimetype
deepikaSingh2711 Sep 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions sdm/src/main/java/com/sap/cds/sdm/constants/SDMConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ private SDMConstants() {
public static final String SDM_CONNECTIONPOOL_PREFIX = "cds.attachments.sdm.http.%s";
public static final String USER_NOT_AUTHORISED_ERROR =
"You do not have the required permissions to upload attachments. Please contact your administrator for access.";
public static final String MIMETYPE_INVALID_ERROR =
"This file type is not allowed in this repository. Contact your administrator for assistance.";
public static final String USER_NOT_AUTHORISED_ERROR_LINK =
"You do not have the required permissions to create links. Please contact your administrator for access.";
public static final String FILE_NOT_FOUND_ERROR = "Object not found in repository";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,11 @@ private void formResponse(
} else if ((responseCode == 403)
&& (responseString.equals("User does not have required scope"))) {
status = "unauthorized";
} else if (responseCode == 403) {
JSONObject jsonResponse = new JSONObject(responseString);
String message = jsonResponse.getString("message");
if ("MIME type of the uploaded file is blocked according to your repository configuration."
.equals(message)) status = "blocked";
} else {
JSONObject jsonResponse = new JSONObject(responseString);
String message = jsonResponse.getString("message");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ private void handleCreateDocumentResult(
throw new ServiceException(createResult.get("message").toString());
case "unauthorized":
throw new ServiceException(SDMConstants.USER_NOT_AUTHORISED_ERROR);
case "blocked":
throw new ServiceException(SDMConstants.MIMETYPE_INVALID_ERROR);
default:
cmisDocument.setObjectId(createResult.get("objectId").toString());
dbQuery.addAttachmentToDraft(
Expand Down
Loading
Loading