DownloadState query ( int downloadId ) { synchronized ( currentRequests ) { for ( DownloadRequest request : currentRequests ) { if ( request . downloadId ( ) == downloadId ) { return request . downloadState ( ) ; } } } return DownloadState . INVALID ; }
To check if the request is downloading according to download id .