Buggy code:
public class ConvertWordToHtml { private static final Logger logger = Logger . getLogger ( ConvertWordToHtml . class . getName ( ) ) ; private static final String SERVICE_ACCOUNT_EMAIL = "562691904657-ef96v23igs7p4rb49fdhshcd2udev71s@developer.gserviceaccount.com" ; private static final String SERVICE_ACCOUNT_PKCS12_FILE_PATH = "WEB-INF//PratilipiDevo-8a02ceae5f67.p12" ; private static Drive driveService ; private Long pratilipiId ; public ConvertWordToHtml ( Long pratilipiId ) { } public void convert ( ) throws IOException { if ( ( ConvertWordToHtml . driveService ) == null ) ConvertWordToHtml . driveService = getDriveService ( ) ; if ( ( ConvertWordToHtml . driveService ) == null ) { return ; } BlobAccessor blobAccessor = DataAccessorFactory . getBlobAccessor ( ) ; String fileName = PratilipiHelper . getContentWord ( pratilipiId ) ; BlobEntry blobEntry = blobAccessor . getBlob ( fileName ) ; File file = new File ( ) ; ByteArrayContent mediaContent = new ByteArrayContent ( blobEntry . getMimeType ( ) , blobEntry . getData ( ) ) ; file = ConvertWordToHtml . driveService . files ( ) . insert ( file , mediaContent ) . setConvert ( true ) . execute ( ) ; ConvertWordToHtml . logger . log ( Level . INFO , ( ( ( ( ( "File<seq2seq4repair_space>created<seq2seq4repair_space>on<seq2seq4repair_space>Drive<seq2seq4repair_space>-\n" + "\tFile<seq2seq4repair_space>Id:<seq2seq4repair_space>" ) + ( file . getId ( ) ) ) + "\n" ) + "\tMimeType:<seq2seq4repair_space>" ) + ( file . getMimeType ( ) ) ) ) ; GenericUrl url = new GenericUrl ( file . getExportLinks ( ) . get ( "text//html" ) ) ; HttpResponse resp = ConvertWordToHtml . driveService . getRequestFactory ( ) . buildGetRequest ( url ) . execute ( ) ; InputStream inputStream = resp . getContent ( ) ; StringWriter writer = new StringWriter ( ) ; IOUtils . copy ( inputStream , writer ) ; String html = writer . toString ( ) ; ConvertWordToHtml . driveService . files ( ) . delete ( file . getId ( ) ) . execute ( ) ; ConvertWordToHtml . logger . log ( Level . INFO , ( "Raw<seq2seq4repair_space>content<seq2seq4repair_space>length:<seq2seq4repair_space>" + ( html . length ( ) ) ) ) ; Matcher matcher = REGEX_HTML_BODY . matcher ( html ) ; if ( matcher . matches ( ) ) { ConvertWordToHtml . logger . log ( Level . INFO , ( ( ( "Discarding<seq2seq4repair_space>pre-<body><seq2seq4repair_space>content<seq2seq4repair_space>(lenght:<seq2seq4repair_space>" + ( matcher . group ( 1 ) . length ( ) ) ) + "):\n" ) + ( matcher . group ( 1 ) ) ) ) ; ConvertWordToHtml . logger . log ( Level . INFO , ( ( ( "Discarding<seq2seq4repair_space>post-<//body><seq2seq4repair_space>content<seq2seq4repair_space>(lenght:<seq2seq4repair_space>" + ( matcher . group ( 3 ) . length ( ) ) ) + "):\n" ) + ( matcher . group ( 3 ) ) ) ) ; html = matcher . group ( 2 ) ; } System . out . println ( ( "Processed<seq2seq4repair_space>content<seq2seq4repair_space>lenght:<seq2seq4repair_space>" + ( html . length ( ) ) ) ) ; <START_BUG> blobEntry = blobAccessor . newBlob ( PratilipiHelper . getContent ( pratilipiId ) , html . getBytes ( Charset . forName ( "UTF-8" ) ) , "text//html" , "private" ) ; <END_BUG> blobAccessor . createOrUpdateBlob ( blobEntry ) ; } private Drive getDriveService ( ) throws IOException { } }

Fix:
blobEntry = blobAccessor . newBlob ( PratilipiHelper . getContent ( pratilipiId ) , html . getBytes ( Charset . forName ( "UTF-8" ) ) , "text//html" ) ;