Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. String uploadedFileName = "sampleFile.xls";
  2. String propertiesPath = "D:/upload/"; // for local testing
  3. FileInputStream fis = new FileInputStream(propertiesPath+ uploadedFileName);
  4. logger.info(fis);
  5.  
  6. HSSFWorkbook workbook=new HSSFWorkbook(fis);
  7. fis.close();
  8.  
  9. FileOutputStream out = null;
  10. try {
  11.  
  12. out = new FileOutputStream("D:/download/codeFrame_1.xls");
  13. workbook.write(out);
  14. } catch (IOException e) {
  15. // TODO Auto-generated catch block
  16. e.printStackTrace();
  17. }finally{
  18. out.close();
  19. out=null;
  20. }
  21. fileName = "codeFrame_1.xls";
  22. fileInputStream = new FileInputStream("D:/download/codeFrame_1.xls");
  23. logger.info("created new file stream");
  24. returnvalue="SUCCESS";
  25. return returnvalue;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement