title: How do I create a Jersey FormDataContentDisposition object?
body: <p>I have the following method in a service:</p>
  <pre><code>public interface MyService {    
      @POST
      @Path(&quot;/upload-file&quot;)
      @Consumes(MediaType.MULTIPART_FORM_DATA)
      void uploadFile(@FormDataParam(&quot;file&quot;) InputStream inputStream,
                      @FormDataParam(&quot;file&quot;) FormDataContentDisposition contentDisposition);
  }
  </code></pre>
  <p>and I create an instance of this interface using WebResourceFactory:</p>
  <pre><code>final MyService buildProxy() {
      final ClientBuilder clientBuidler = ClientBuilder.newBuilder();
      // register components, trust manager, etc.
      final WebTarget target = clientBuilder.build().target(&quot;http://myservice.example.com&quot;);
      return WebResourceFactory.newResource(
              MyService.class, target, false, ImmutableMultivaluedMap.empty(), 
              Collections.emptyList(), new Form());
  }
  </code></pre>
  <p>I want to call my method using this proxy, but I can't find a convenient way to create a <code>FormDataContentDisposition</code>. Is my best bet really going to be to create the header string, and then pass that into <code>new FormDataContentDisposition(String header)</code>? Can I relax my types somewhere to get access to a more convenient constructor? Is there a different, more convenient interface I can use in a file-upload? I'm mainly including the content-disposition in my interface so I can reject a file that is too large before I save the entire thing to disk.</p>