-1

I need to write a application to copy files(.jar,.xml,.sql,.exe) from different location to some specific location What would be the most efficient way of file copy using java?

user1741249
  • 43
  • 1
  • 8

2 Answers2

3

Use java.nio.file.Files.File#copy which intoduced in java 7. Example -

Files.copy(source, target, REPLACE_EXISTING);
Subhrajyoti Majumder
  • 40,646
  • 13
  • 77
  • 103
2

This is covered, in some detail, in Basic I/O tutorial

MadProgrammer
  • 343,457
  • 22
  • 230
  • 366