@@ -561,7 +561,7 @@ protected Response post(StreamingOutput stream, String mediaType, Object... path
561561 *
562562 * @param name the name for the form field that contains the file name
563563 * @param fileToUpload a File instance pointing to the file to upload
564- * @param mediaTypeString the content-type of the uploaded file, if null will be determined from fileToUpload
564+ * @param mediaTypeString unused; will be removed in the next major version
565565 * @param pathArgs variable list of arguments used to build the URI
566566 * @return a ClientResponse instance with the data returned from the endpoint
567567 * @throws IOException if an error occurs while constructing the URL
@@ -576,7 +576,7 @@ protected Response upload(String name, File fileToUpload, String mediaTypeString
576576 *
577577 * @param name the name for the form field that contains the file name
578578 * @param fileToUpload a File instance pointing to the file to upload
579- * @param mediaTypeString the content-type of the uploaded file, if null will be determined from fileToUpload
579+ * @param mediaTypeString unused; will be removed in the next major version
580580 * @param formData the Form containing the name/value pairs
581581 * @param pathArgs variable list of arguments used to build the URI
582582 * @return a ClientResponse instance with the data returned from the endpoint
@@ -593,17 +593,14 @@ protected Response upload(String name, File fileToUpload, String mediaTypeString
593593 *
594594 * @param name the name for the form field that contains the file name
595595 * @param fileToUpload a File instance pointing to the file to upload
596- * @param mediaTypeString the content-type of the uploaded file, if null will be determined from fileToUpload
596+ * @param mediaTypeString unused; will be removed in the next major version
597597 * @param formData the Form containing the name/value pairs
598598 * @param url the fully formed path to the GitLab API endpoint
599599 * @return a ClientResponse instance with the data returned from the endpoint
600600 * @throws IOException if an error occurs while constructing the URL
601601 */
602602 protected Response upload (String name , File fileToUpload , String mediaTypeString , Form formData , URL url ) throws IOException {
603- MediaType mediaType = (mediaTypeString != null ? MediaType .valueOf (mediaTypeString ) : null );
604- FileDataBodyPart filePart = mediaType != null ?
605- new FileDataBodyPart (name , fileToUpload , mediaType ) :
606- new FileDataBodyPart (name , fileToUpload );
603+ FileDataBodyPart filePart = new FileDataBodyPart (name , fileToUpload );
607604 return upload (filePart , formData , url );
608605 }
609606
@@ -613,10 +610,7 @@ protected Response upload(String name, InputStream inputStream, String filename,
613610 }
614611
615612 protected Response upload (String name , InputStream inputStream , String filename , String mediaTypeString , Form formData , URL url ) throws IOException {
616- MediaType mediaType = (mediaTypeString != null ? MediaType .valueOf (mediaTypeString ) : null );
617- StreamDataBodyPart streamDataBodyPart = mediaType != null ?
618- new StreamDataBodyPart (name , inputStream , filename , mediaType ) :
619- new StreamDataBodyPart (name , inputStream , filename );
613+ StreamDataBodyPart streamDataBodyPart = new StreamDataBodyPart (name , inputStream , filename );
620614 return upload (streamDataBodyPart , formData , url );
621615 }
622616
0 commit comments