Code example for URL

Methods: getFile

    public DownloadTask(Context context, String url, String path, DownloadTaskListener listener)
            throws MalformedURLException { 
        this.url = url;
        this.URL = new URL(url);
        this.listener = listener;
        String fileName = new File(URL.getFile()).getName();
        this.file = new File(path, fileName);
        this.tempFile = new File(path, fileName + TEMP_SUFFIX);
        this.context = context;
    public String getUrl() {
        return url;
    public boolean isInterrupt() { 
Connect your IDE to all the code out there  Get Codota for Java