Parse file name from URL before downloading the file

后端 未结 6 1657
眼角桃花
眼角桃花 2020-12-24 01:18

I\'m downloading an ePub file from a URL.

Now I want to implement a mechanism by which if user tries to re-download the same file, he should get warning/error messag

6条回答
  •  半阙折子戏
    2020-12-24 02:11

    Try to use URLUtil.guessFileName(url, null, null) for example. I think this is the best Android way.

    More info here: https://developer.android.com/reference/android/webkit/URLUtil.html#guessFileName(java.lang.String, java.lang.String, java.lang.String)

提交回复
热议问题