复制文件功能:
说明:
//源文件 路径真是存在
File sourceFile=new File("ftp源文件绝对路径")
FileChannel sourceChannel=new FileInputStream(sourceFile).getFileChannel();
//目标文件
File file=new File("ftp源文件绝对路径")
FileChannel fileChannel=new FileInputStream(file).getFileChannel();
Long len=fileChannel.transForm(sourceChannel,0,sourceChannel.size());
//判断是否拷贝完成
if(len==sourceChannel.size()){
system.out.printlen("拷贝文件完成");
};