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
255255 for (Map .Entry <String , InputStream > entry : createClassifierOptions .positiveExamples ().entrySet ()) {
256256 String partName = String .format ("%s_positive_examples" , entry .getKey ());
257257 RequestBody part = RequestUtils .inputStreamBody (entry .getValue (), "application/octet-stream" );
258- multipartBuilder .addFormDataPart (partName , entry .getKey (), part );
258+ multipartBuilder .addFormDataPart (partName , entry .getKey () + ".zip" , part );
259259 }
260260 if (createClassifierOptions .negativeExamples () != null ) {
261261 RequestBody negativeExamplesBody = RequestUtils .inputStreamBody (createClassifierOptions .negativeExamples (),
262262 "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 );
265268 }
266269 builder .body (multipartBuilder .build ());
267270 ResponseConverter <Classifier > responseConverter = ResponseConverterUtils .getValue (
You can’t perform that action at this time.
0 commit comments