Hi Amit,
you can easily create an url for document and media entities like this:
1/documents/{groupId}/{folderId}/httpUtil.encodeURL(htmlUtil.unescape({title}))
I've put the needed parameters in brackets. If you have a dlFileEntry object you can get them from it.
HTH Oli