title: Create text file and add to zip file and download spring boot with out savind in local server
body: <p>create and download zip file by adding list of text files. with out creating the file in local server, it should be download at client side direct,
   Here i added a code snippet, it was creating in local server, but i dont want that, it should create and download at client side instant. Please help me in this way..</p>
  
  <pre><code>@GetMapping("/download/rawdata")
      public void downloadRawdata(@RequestParam("date") String date){
  
          log.info("date : "+date);
          List&lt;Rawdata&gt; rawdatas = rawdataRepoisotry.findRawdataByDate(date);
          log.info("size of rawdata : "+rawdatas.size());
          List&lt;File&gt; files = new ArrayList&lt;File&gt;();
          int i = 1;
          for(Rawdata rawdata : rawdatas){
          log.info("rawdata : "+ rawdata.getRawdata());
              File file = new File(i+".txt");
  
              try (Writer writer = new BufferedWriter(new FileWriter(file))) {
                  String contents = rawdata.getRawdata(); 
                  writer.write(contents);
                  files.add(file);
              } catch (IOException e) {
                  e.printStackTrace();
              }
              i++;
          }
  
          try {
              zipFile(files, new File(date+".zip"));
          } catch (IOException e) {
              e.printStackTrace();
              throw new RuntimeException("Failed while creating Zip file");
          }
  
      }
  
  
      public FileOutputStream zipFile(final List&lt;File&gt; files, final File targetZipFile) throws IOException {
          try {
            FileOutputStream   fos = new FileOutputStream(targetZipFile);
            ZipOutputStream zos = new ZipOutputStream(fos);
            byte[] buffer = new byte[128];
            for(File currentFile : files){
                  if (!currentFile.isDirectory()) {
                    ZipEntry entry = new ZipEntry(currentFile.getName());
                    FileInputStream fis = new FileInputStream(currentFile);
                    zos.putNextEntry(entry);
                    int read = 0;
                    while ((read = fis.read(buffer)) != -1) {
                      zos.write(buffer, 0, read);
                    }
                    zos.closeEntry();
                    fis.close();
                  }
            }
            zos.close();
            fos.close();
            return fos;
          } catch (FileNotFoundException e) {
            System.out.println("File not found : " + e);
            throw new FileNotFoundException();
          }
  
  
        }
  </code></pre>