public double getProgressFromResponse ( ResponseOnSingeRequest myResponse ) { double progress = 0.0 ; try { if ( myResponse == null || myResponse . isFailObtainResponse ( ) ) { return progress ; } String responseBody = myResponse . getResponseBody ( ) ; Pattern regex = Pattern . compile ( progressRegex ) ; Matcher matcher = regex . matcher ( responseBody ) ; if ( matcher . matches ( ) ) { String progressStr = matcher . group ( 1 ) ; progress = Double . parseDouble ( progressStr ) ; } } catch ( Exception t ) { logger . error ( "fail " + t ) ; } return progress ; }
Gets the progress from response .