private void cleanupDestination ( DownloadRequest request , boolean forceClean ) { if ( ! request . isResumable ( ) || forceClean ) { Log . d ( "cleanupDestination() deleting " + request . getDestinationURI ( ) . getPath ( ) ) ; File destinationFile = new File ( request . getDestinationURI ( ) . getPath ( ) ) ; if ( destinationFile . exists ( ) ) { destinationFile . delete ( ) ; } } }
Called just before the thread finishes regardless of status to take any necessary action on the downloaded file with mDownloadedCacheSize file .