public byte[] downloadLog(CloudTrailLog ctLog, CloudTrailSource source) {
        boolean success = false;
        ProgressStatus downloadLogStatus = new ProgressStatus(ProgressState.downloadLog, new BasicProcessLogInfo(source, ctLog, success));
        final Object downloadSourceReportObject = progressReporter.reportStart(downloadLogStatus);

        byte[] s3ObjectBytes = null;

        // start to download CloudTrail log
        try {
            S3Object s3Object = this.getObject(ctLog.getS3Bucket(), ctLog.getS3ObjectKey());
            try (S3ObjectInputStream s3InputStream = s3Object.getObjectContent()){
                s3ObjectBytes = LibraryUtils.toByteArray(s3InputStream);
            }
            ctLog.setLogFileSize(s3Object.getObjectMetadata().getContentLength());
            success = true;
            logger.info("Downloaded log file " + ctLog.getS3ObjectKey() + " from " + ctLog.getS3Bucket());

        } catch (AmazonServiceException | IOException e) {
            String exceptionMessage = String.format("Fail to download log file %s/%s.", ctLog.getS3Bucket(), ctLog.getS3ObjectKey());
            LibraryUtils.handleException(exceptionHandler, downloadLogStatus, e, exceptionMessage);

        } finally {
            LibraryUtils.endToProcess(progressReporter, success, downloadLogStatus, downloadSourceReportObject);
        }

        return s3ObjectBytes;
    }
public byte [ ] downloadLog ( CloudTrailLog ctLog , CloudTrailSource source ) { boolean success = false ; ProgressStatus downloadLogStatus = new ProgressStatus ( ProgressState . downloadLog , new BasicProcessLogInfo ( source , ctLog , success ) ) ; final Object downloadSourceReportObject = progressReporter . reportStart ( downloadLogStatus ) ; byte [ ] s3ObjectBytes = null ; try { S3Object s3Object = this . getObject ( ctLog . getS3Bucket ( ) , ctLog . getS3ObjectKey ( ) ) ; try ( S3ObjectInputStream s3InputStream = s3Object . getObjectContent ( ) ) { s3ObjectBytes = LibraryUtils . toByteArray ( s3InputStream ) ; } ctLog . setLogFileSize ( s3Object . getObjectMetadata ( ) . getContentLength ( ) ) ; success = true ; logger . info ( "Downloaded log file " + ctLog . getS3ObjectKey ( ) + " from " + ctLog . getS3Bucket ( ) ) ; } catch ( AmazonServiceException | IOException e ) { String exceptionMessage = String . format ( "Fail to download log file %s/%s." , ctLog . getS3Bucket ( ) , ctLog . getS3ObjectKey ( ) ) ; LibraryUtils . handleException ( exceptionHandler , downloadLogStatus , e , exceptionMessage ) ; } finally { LibraryUtils . endToProcess ( progressReporter , success , downloadLogStatus , downloadSourceReportObject ) ; } return s3ObjectBytes ; }
Downloads an AWS CloudTrail log from the specified source.

@param ctLog The {@link CloudTrailLog} to download
@param source The {@link CloudTrailSource} to download the log from.
@return A byte array containing the log data.