public static String replace ( String string , UploadInfo uploadInfo ) { if ( string == null || string . isEmpty ( ) ) return "" ; String tmp ; tmp = string . replace ( ELAPSED_TIME , uploadInfo . getElapsedTimeString ( ) ) ; tmp = tmp . replace ( PROGRESS , uploadInfo . getProgressPercent ( ) + "%" ) ; tmp = tmp . replace ( UPLOAD_RATE , uploadInfo . getUploadRateString ( ) ) ; tmp = tmp . replace ( UPLOADED_FILES , Integer . toString ( uploadInfo . getSuccessfullyUploadedFiles ( ) . size ( ) ) ) ; tmp = tmp . replace ( TOTAL_FILES , Integer . toString ( uploadInfo . getTotalFiles ( ) ) ) ; return tmp ; }
Replace placeholders in a string .