code: public void addBodyFileUpload(String name, String filename, File file, String contentType, boolean isText)
              throws ErrorDataEncoderException {
          checkNotNull(name, "name");
          checkNotNull(file, "file");
          if (filename == null) {
              filename = StringUtil.EMPTY_STRING;
          }
          String scontentType = contentType;
          String contentTransferEncoding = null;
          if (contentType == null) {
              if (isText) {
                  scontentType = HttpPostBodyUtil.DEFAULT_TEXT_CONTENT_TYPE;
              } else {
                  scontentType = HttpPostBodyUtil.DEFAULT_BINARY_CONTENT_TYPE;
              }
          }
          if (!isText) {
              contentTransferEncoding = HttpPostBodyUtil.TransferEncodingMechanism.BINARY.value();
          }
          FileUpload fileUpload = factory.createFileUpload(request, name, filename, scontentType,
                  contentTransferEncoding, null, file.length());
          try {
              fileUpload.setContent(file);
          } catch (IOException e) {
              throw new ErrorDataEncoderException(e);
          }
          addBodyHttpData(fileUpload);
      }
docs: Add a file as a FileUpload
  
  @param name
  the name of the parameter
  @param file
  the file to be uploaded (if not Multipart mode, only the filename will be included)
  @param filename
  the filename to use for this File part, empty String will be ignored by
  the encoder
  @param contentType
  the associated contentType for the File
  @param isText
  True if this file should be transmitted in Text format (else binary)
  @throws NullPointerException
  for name and file
  @throws ErrorDataEncoderException
  if the encoding is in error or if the finalize were already done