Buggy code:
@ SuppressWarnings ( "serial" ) public class QueueWordToPratilipiServlet extends HttpServlet { private static final Logger logger = Logger . getLogger ( QueueWordToPratilipiServlet . 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-a987225aa0b1.p12" ; private static Drive driveService ; @ Override public void doPost ( HttpServletRequest request , HttpServletResponse response ) throws IOException { if ( ( QueueWordToPratilipiServlet . driveService ) == null ) QueueWordToPratilipiServlet . driveService = getDriveService ( ) ; if ( ( QueueWordToPratilipiServlet . driveService ) == null ) { response . sendError ( SC_INTERNAL_SERVER_ERROR ) ; return ; } String pratilipiIdStr = request . getParameter ( "pratilipiId" ) ; Long pratilipiId = Long . parseLong ( pratilipiIdStr ) ; 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 = QueueWordToPratilipiServlet . driveService . files ( ) . insert ( file , mediaContent ) . setConvert ( true ) . execute ( ) ; QueueWordToPratilipiServlet . 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 = QueueWordToPratilipiServlet . driveService . getRequestFactory ( ) . buildGetRequest ( url ) . execute ( ) ; InputStream inputStream = resp . getContent ( ) ; StringWriter writer = new StringWriter ( ) ; IOUtils . copy ( inputStream , writer ) ; String html = writer . toString ( ) ; QueueWordToPratilipiServlet . driveService . files ( ) . delete ( file . getId ( ) ) . execute ( ) ; QueueWordToPratilipiServlet . 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 ( ) ) { QueueWordToPratilipiServlet . 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 ) ) ) ) ; QueueWordToPratilipiServlet . 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" ) ;