Guest User

Untitled

a guest
Mar 20th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. FileChannel inputChannel = null;
  2. FileChannel outputChannel = null;
  3. String sourceFilePathStr="â€ĒC:\Users\abc xyz\Downloads";
  4. File source = new File(sourceFilePathStr,"designspec.docx");
  5. File dest = new File(repo.getDirectory().getParent(),"designspec.docx");
  6.  
  7. inputChannel = new FileInputStream(source).getChannel();
  8. outputChannel = new FileOutputStream(dest).getChannel();
  9. outputChannel.transferFrom(inputChannel, 0, inputChannel.size());
  10. log.info("copy complete");
  11. } finally {
  12. inputChannel.close();
  13. outputChannel.close();
  14. }
  15.  
  16. inputChannel.close();
Add Comment
Please, Sign In to add comment