Sorting media entries by name

I am trying to sort media entries by name using below java code:

KalturaMediaEntryFilter filter = new KalturaMediaEntryFilter();
filter.typeIn = "1";
filter.orderBy = KalturaMediaEntryOrderBy.NAME_DESC.toString();
KalturaMediaListResponse listResponse = mediaService.list(filter);

But “orderBy” element does not have any effect on the results, I tried multiple options but getting same results.

Can someone please reply on this, as some how I am not able to get it working.

Hello,

I believe this is what you want:   

 class CodeExample{
    public static void main(String[] args){
    try{
    KalturaConfiguration config = new KalturaConfiguration();
    config.setPartnerId(partnerId);
    config.setEndpoint("");
    KalturaClient client = new KalturaClient(config);
    KalturaMediaEntryFilter filter = new KalturaMediaEntryFilter();
    String filter.orderBy = "";
    KalturaFilterPager pager = null;
    Object result = client.getMediaService().list(filter, pager);
    }catch(KalturaApiException e){
    e.printStackTrace();
    }
    }
    }