-
Notifications
You must be signed in to change notification settings - Fork 8
Conversation
*/ | ||
public RealmService getRealmService() { | ||
|
||
return MediaEndpointDataHolder.getInstance().realmService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to calll MediaEndpointDataHolder.getInstance() here.. we can directly return realmService
*/ | ||
public void setRealmService(RealmService realmService) { | ||
|
||
MediaEndpointDataHolder.getInstance().realmService = realmService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to this.realmService = realmService
...rc/main/java/org/wso2/carbon/identity/media/endpoint/common/factory/RealmServiceFactory.java
Outdated
Show resolved
Hide resolved
...dia.endpoint/src/main/java/org/wso2/carbon/identity/media/endpoint/service/MediaService.java
Outdated
Show resolved
Hide resolved
* @param identifier File identifier. | ||
* @return requested media file. | ||
*/ | ||
public Response downloadMediaFile(String type, String id, String identifier) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we add validation for type also? what will happen if type is null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...nt/src/main/java/org/wso2/carbon/identity/media/endpoint/common/MediaEndpointDataHolder.java
Outdated
Show resolved
Hide resolved
@@ -48,7 +48,7 @@ public Response privilegedUserListMediaInformation(String type, String id) { | |||
public Response privilegedUserUploadMedia(String type, List<InputStream> filesInputStream, | |||
List<Attachment> filesDetail, PrivilegedUserMetadata metadata) { | |||
|
|||
mediaService.validateMediaType(type, filesDetail.get(0).getContentType()); | |||
mediaService.validateAllowedMediaTypesForUploading(type, filesDetail.get(0).getContentType()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we change the method name to, validateFileUploadMediaTypes or something similar?
Issue: wso2/product-is#8499