@@ -51,26 +51,26 @@ public class InternalBatchDriverImpl extends BaseArangoDriverImpl {
51
51
52
52
public DefaultEntity executeBatch (List <BatchPart > callStack , String defaultDataBase ) throws ArangoException {
53
53
54
- String body = "" ;
54
+ StringBuilder body = new StringBuilder () ;
55
55
56
56
Map <String , InvocationObject > resolver = new HashMap <String , InvocationObject >();
57
57
58
58
for (BatchPart bp : callStack ) {
59
- body += "--" + delimiter + newline ;
60
- body += "Content-Type: application/x-arango-batchpart" + newline ;
61
- body += "Content-Id: " + bp .getId () + newline + newline ;
62
- body += bp .getMethod () + " " + bp .getUrl () + " " + "HTTP/1.1" + newline ;
63
- body += "Host: " + this .configure .getArangoHost ().getHost () + newline + newline ;
64
- body += bp .getBody () == null ? "" : bp .getBody () + newline + newline ;
59
+ body . append ( "--" ). append ( delimiter ). append ( newline ) ;
60
+ body . append ( "Content-Type: application/x-arango-batchpart" ). append ( newline ) ;
61
+ body . append ( "Content-Id: " ). append ( bp .getId ()). append ( newline ). append ( newline ) ;
62
+ body . append ( bp .getMethod ()). append ( " " ). append ( bp .getUrl ()). append ( " " ). append ( "HTTP/1.1" ). append ( newline ) ;
63
+ body . append ( "Host: " ). append ( this .configure .getArangoHost ().getHost ()). append ( newline ). append ( newline ) ;
64
+ body . append ( bp .getBody () == null ? "" : bp .getBody ()). append ( newline ). append ( newline ) ;
65
65
resolver .put (bp .getId (), bp .getInvocationObject ());
66
66
}
67
- body += "--" + delimiter + "--" ;
67
+ body . append ( "--" ). append ( delimiter ). append ( "--" ) ;
68
68
69
69
Map <String , Object > headers = new HashMap <String , Object >();
70
70
headers .put ("Content-Type" , "multipart/form-data; boundary=" + delimiter );
71
71
72
72
HttpResponseEntity res = httpManager .doPostWithHeaders (createEndpointUrl (defaultDataBase , "/_api/batch" ), null ,
73
- null , headers , body );
73
+ null , headers , body . toString () );
74
74
75
75
String data = res .getText ();
76
76
res .setContentType ("application/json" );
0 commit comments