File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/main/java/com/amihaiemil/docker Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 27
27
28
28
import java .io .IOException ;
29
29
import java .net .URI ;
30
+ import javax .json .Json ;
30
31
import javax .json .JsonObject ;
31
32
32
33
import org .apache .http .HttpStatus ;
@@ -112,7 +113,8 @@ public void connect(final String containerId)
112
113
);
113
114
post .setEntity (
114
115
new StringEntity (
115
- String .format ("{\" Container\" : \" %s\" }" , containerId )
116
+ Json .createObjectBuilder ().add ("Container" , containerId )
117
+ .build ().toString ()
116
118
)
117
119
);
118
120
try {
@@ -136,10 +138,10 @@ public void disconnect(final String containerId)
136
138
);
137
139
post .setEntity (
138
140
new StringEntity (
139
- String . format (
140
- "{ \" Container\" : \" %s \" , \" Force \" : \" true \" }" ,
141
- containerId
142
- )
141
+ Json . createObjectBuilder ()
142
+ . add ( " Container" , containerId )
143
+ . add ( "Force" , "true" )
144
+ . build (). toString ( )
143
145
)
144
146
);
145
147
try {
You can’t perform that action at this time.
0 commit comments