File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
visual-recognition/src/main/java/com/ibm/watson/visual_recognition/v3 Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -255,13 +255,16 @@ public ServiceCall<Classifier> createClassifier(CreateClassifierOptions createCl
255
255
for (Map .Entry <String , InputStream > entry : createClassifierOptions .positiveExamples ().entrySet ()) {
256
256
String partName = String .format ("%s_positive_examples" , entry .getKey ());
257
257
RequestBody part = RequestUtils .inputStreamBody (entry .getValue (), "application/octet-stream" );
258
- multipartBuilder .addFormDataPart (partName , entry .getKey (), part );
258
+ multipartBuilder .addFormDataPart (partName , entry .getKey () + ".zip" , part );
259
259
}
260
260
if (createClassifierOptions .negativeExamples () != null ) {
261
261
RequestBody negativeExamplesBody = RequestUtils .inputStreamBody (createClassifierOptions .negativeExamples (),
262
262
"application/octet-stream" );
263
- multipartBuilder .addFormDataPart ("negative_examples" , createClassifierOptions .negativeExamplesFilename (),
264
- negativeExamplesBody );
263
+ String negativeExamplesFilename = createClassifierOptions .negativeExamplesFilename ();
264
+ if (!negativeExamplesFilename .contains ("." )) {
265
+ negativeExamplesFilename += ".zip" ;
266
+ }
267
+ multipartBuilder .addFormDataPart ("negative_examples" , negativeExamplesFilename , negativeExamplesBody );
265
268
}
266
269
builder .body (multipartBuilder .build ());
267
270
ResponseConverter <Classifier > responseConverter = ResponseConverterUtils .getValue (
You can’t perform that action at this time.
0 commit comments