@@ -152,36 +152,6 @@ private void doUpload(List<Scope> scopesToSerialize, byte[] payload, boolean isC
152152 "" , event , new BatchUploader .MultiPartContent (payload , "file" , fileName , mediaType ));
153153 }
154154
155- private void doUpload (List <Scope > scopesToSerialize , String json ) {
156- byte [] jsonBytes = json .getBytes (StandardCharsets .UTF_8 );
157- byte [] payload = null ;
158- if (isCompressed ) {
159- payload = compressPayload (jsonBytes );
160- }
161- if (payload == null ) {
162- if (json .length () > maxPayloadSize ) {
163- LOGGER .warn ("Payload is too big: {}/{}" , json .length (), maxPayloadSize );
164- splitAndSend (scopesToSerialize );
165- return ;
166- }
167- symbolUploader .uploadAsMultipart (
168- "" ,
169- event ,
170- new BatchUploader .MultiPartContent (jsonBytes , "file" , "file.json" , APPLICATION_JSON ));
171- } else {
172- if (payload .length > maxPayloadSize ) {
173- LOGGER .warn ("Compressed payload is too big: {}/{}" , payload .length , maxPayloadSize );
174- splitAndSend (scopesToSerialize );
175- return ;
176- }
177- LOGGER .debug ("Sending {} jar scopes size={}" , scopesToSerialize .size (), payload .length );
178- symbolUploader .uploadAsMultipart (
179- "" ,
180- event ,
181- new BatchUploader .MultiPartContent (payload , "file" , "file.gz" , APPLICATION_GZIP ));
182- }
183- }
184-
185155 private static byte [] compressPayload (byte [] jsonBytes ) {
186156 // usual compression factor 40:1 for those json payload, so we are preallocating 1/40
187157 ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream (jsonBytes .length / 40 );
0 commit comments