@ SuppressWarnings ( "squid:S134" ) private void createHtmlReport ( FilePath reportFolder , String testFolderPath , File artifactsDir , List < String > reportNames , TestResult testResult ) throws IOException , InterruptedException { String archiveTestResultMode = _resultsPublisherModel . getArchiveTestResultsMode ( ) ; boolean createReport = archiveTestResultMode . equals ( ResultsPublisherModel . CreateHtmlReportResults . getValue ( ) ) ; if ( createReport ) { File testFolderPathFile = new File ( testFolderPath ) ; FilePath srcDirectoryFilePath = new FilePath ( reportFolder , HTML_REPORT_FOLDER ) ; if ( srcDirectoryFilePath . exists ( ) ) { FilePath srcFilePath = new FilePath ( srcDirectoryFilePath , IE_REPORT_FOLDER ) ; if ( srcFilePath . exists ( ) ) { ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; srcFilePath . zip ( baos ) ; File reportDirectory = new File ( artifactsDir . getParent ( ) , PERFORMANCE_REPORT_FOLDER ) ; if ( ! reportDirectory . exists ( ) ) { reportDirectory . mkdir ( ) ; } ByteArrayInputStream bais = new ByteArrayInputStream ( baos . toByteArray ( ) ) ; FilePath reportDirectoryFilePath = new FilePath ( reportDirectory ) ; FilePath tmpZipFile = new FilePath ( reportDirectoryFilePath , "tmp.zip" ) ; tmpZipFile . copyFrom ( bais ) ; bais . close ( ) ; baos . close ( ) ; tmpZipFile . unzip ( reportDirectoryFilePath ) ; String newFolderName = org . apache . commons . io . FilenameUtils . getName ( testFolderPathFile . getPath ( ) ) ; FileUtils . moveDirectory ( new File ( reportDirectory , IE_REPORT_FOLDER ) , new File ( reportDirectory , newFolderName ) ) ; tmpZipFile . delete ( ) ; outputReportFiles ( reportNames , reportDirectory , testResult , false ) ; } } } }
Copy Summary Html reports created by LoadRunner