Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. static File file;
  2.  
  3. @BeforeAll
  4. static void setUp() throws IOException {
  5.  
  6. ZipOutputStream out = new ZipOutputStream(new FileOutputStream(file=File.createTempFile("tempDir",".zip")));
  7.  
  8. ZipEntry e = new ZipEntry("emptyFile.txt");
  9. out.putNextEntry(e);
  10. out.closeEntry();
  11.  
  12. e = new ZipEntry("oneLineFile.txt");
  13. out.putNextEntry(e);
  14.  
  15. StringBuilder sb;
  16. byte[] data;
  17. sb = new StringBuilder();
  18. sb.append("route_id,agency_id,route_short_name,route_long_name,route_type");
  19. data = sb.toString().getBytes();
  20. out.write(data, 0, data.length);
  21.  
  22. out.closeEntry();
  23.  
  24. out.close();
  25. }
  26.  
  27. @AfterAll
  28. static void set(){
  29.  
  30. file.delete(); // return false
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement