-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
  • 39,719
  • 12
  • 74
  • 101
2

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

MadProgrammer
  • 336,120
  • 22
  • 219
  • 344