code: protected RequestEntity createMultiPartRequestContent(HTTPRequest httpRequest,HttpMethodBase httpMethodClient)
      {
          RequestEntity requestEntity=null;
          ContentPart<?>[] contentParts=httpRequest.getContentAsParts();
          if(contentParts!=null)
          {
              int partsAmount=contentParts.length;
              
              if(partsAmount>0)
              {
                  //init array
                  Part[] parts=new Part[partsAmount];
  
                  ContentPart<?> contentPart=null;
                  String name=null;
                  Object content=null;
                  ContentPartType contentPartType=null;
                  for(int index=0;index<partsAmount;index++)
                  {
                      //get next part
                      contentPart=contentParts[index];
  
                      if(contentPart!=null)
                      {
                          //get part values
                          name=contentPart.getName();
                          content=contentPart.getContent();
                          contentPartType=contentPart.getType();
                          
                          //create new part
                          switch(contentPartType)
                          {
                              case FILE:
                                  File file=(File)content;
                                  try
                                  {
                                      parts[index]=new FilePart(name,file);
                                  }
                                  catch(FileNotFoundException exception)
                                  {
                                      throw new FaxException("Fax file: "+file.getAbsolutePath()+" not found.",exception);
                                  }
                                  break;
                              case STRING:
                                  parts[index]=new StringPart(name,(String)content);
                                  break;
                              default:
                                  throw new FaxException("Unsupported content type provided: "+contentPartType);
                          }
                      }
                  }
                  requestEntity=new MultipartRequestEntity(parts,httpMethodClient.getParams());
              }
          }
          
          return requestEntity;
      }
docs: This function creates a multi part type request entity and populates it
  with the data from the provided HTTP request.
  
  @param   httpRequest
  The HTTP request
  @param   httpMethodClient
  The apache HTTP method
  @return  The request entity