Class SampleFileUpload


  • public class SampleFileUpload
    extends Object
    • Constructor Detail

      • SampleFileUpload

        public SampleFileUpload()
    • Method Detail

      • executeMultiPartRequest

        public String executeMultiPartRequest​(String urlString,
                                              File file,
                                              String fileName,
                                              String fileDescription)
        Method that builds the multi-part form data request
        Parameters:
        urlString - the urlString to which the file needs to be uploaded
        file - the actual file instance that needs to be uploaded
        fileName - name of the file, just to show how to add the usual form parameters
        fileDescription - some description for the file, just to show how to add the usual form parameters
        Returns:
        server response as String
      • main

        public static void main​(String[] args)