public class ContentTypeFilePart extends FilePart
A simple extension to FilePart that automatically determines the content type of the file.
Version:
$Revision $ DISCLAIMER: HttpClient developers DO NOT actively support this component. The component is provided as a reference material, which may be inappropriate to be used without additional customization.
  • Constructor Details

    • ContentTypeFilePart

      public ContentTypeFilePart(String name, PartSource partSource, String charset)
      ContentTypeFilePart constructor.
      Parameters:
      name - the name of the part
      partSource - the source for this part
      charset - the charset encoding for this part.
    • ContentTypeFilePart

      public ContentTypeFilePart(String name, PartSource partSource)
      ContentTypeFilePart constructor.
      Parameters:
      name - the name of the part
      partSource - the source for this part
    • ContentTypeFilePart

      public ContentTypeFilePart(String name, File file) throws FileNotFoundException
      ContentTypeFilePart constructor.
      Parameters:
      name - the name of the part
      file - the file to post
      Throws:
      FileNotFoundException - if the file does not exist
    • ContentTypeFilePart

      public ContentTypeFilePart(String name, File file, String charset) throws FileNotFoundException
      ContentTypeFilePart constructor.
      Parameters:
      name - the name of the part
      file - the file to post
      charset - the charset encoding for the file
      Throws:
      FileNotFoundException
    • ContentTypeFilePart

      public ContentTypeFilePart(String name, String fileName, File file) throws FileNotFoundException
      ContentTypeFilePart constructor.
      Parameters:
      name - the name of the part
      fileName - the file name
      file - the file to post
      Throws:
      FileNotFoundException - if the file does not exist
    • ContentTypeFilePart

      public ContentTypeFilePart(String name, String fileName, File file, String charset) throws FileNotFoundException
      ContentTypeFilePart constructor.
      Parameters:
      name - the name of the part
      fileName - the file name
      file - the file to post
      charset - the charset encoding for the file
      Throws:
      FileNotFoundException - if the file does not exist