类 Parts


  • public class Parts
    extends Object
    Utils for create Part
    • 构造器详细资料

      • Parts

        public Parts()
    • 方法详细资料

      • file

        public static Part<InputSupplier> file​(String name,
                                               Path path,
                                               MimeType mimeType)
        Create a file multi-part form field. The Text Part just as html input field:
           <input type="file" name="the_name">
         
        参数:
        name - the part name
        path - the file path
        mimeType - the mimeType
      • file

        public static Part<InputSupplier> file​(String name,
                                               Path path)
        Create a file multi-part form field. The Text Part just as html input field:
           <input type="file" name="the_name">
         
        The mime-type will be detected from file name extension. If detect failed, use MimeType.OCTET_STREAM
        参数:
        name - the part name
        path - the file path
      • file

        public static Part<InputSupplier> file​(String name,
                                               String filename,
                                               InputSupplier supplier,
                                               MimeType mimeType)
        Create a file multi-part form field. The Text Part just as html
           <input type="file" name="the_name">
         
        do.
        参数:
        name - the part name
        filename - the filename, can be empty
        supplier - the file content provider
        mimeType - the mimeType
      • file

        public static Part<InputSupplier> file​(String name,
                                               String filename,
                                               byte[] bytes,
                                               MimeType mimeType)
        Create a file multi-part form field. The Text Part just as html
           <input type="file" name="the_name">
         
        do.
        参数:
        name - the part name
        filename - the filename, can be empty
        bytes - the file content
        mimeType - the mimeType
      • text

        public static Part<String> text​(String name,
                                        String value)
        Create a text multi-part form field. The Text Part just as html
               <input type="text" name="the_name" value="the_value">
         
        do.