Skip to content
This repository has been archived by the owner on Apr 21, 2024. It is now read-only.

Add media download operation. #19

Merged
merged 2 commits into from
Jul 1, 2020
Merged

Conversation

dewniMW
Copy link
Contributor

@dewniMW dewniMW commented Jun 29, 2020

*/
public RealmService getRealmService() {

return MediaEndpointDataHolder.getInstance().realmService;
Copy link
Contributor

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;
Copy link
Contributor

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

* @param identifier File identifier.
* @return requested media file.
*/
public Response downloadMediaFile(String type, String id, String identifier) {
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -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());
Copy link
Contributor

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?

@dewniMW dewniMW merged commit daee6c0 into wso2-attic:master Jul 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants