list.txt 内容
ftp://www.test.com/hello/test.txt 8-Sep-2015 11:53
FileInputStream fis = new FileInputStream("Z:\\list.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(fis));
String str;
while ((str = br.readLine()) != null)
{
System.out.println(str);
String[] ss = str.split("\\s{1,}");//以空格分割
if(ss.length==3){
String fileUrl =ss[0]; //获取到文件的url
String fileDate =ss[1]+" "+ss[2]; //获取文件的时间,因为时间中间也是有空格,这里分割后再次拼接到一起
String fileName = str.substring(fileUrl.lastIndexOf("/")+1, fileUrl.length());//获取文件的名字,以便在后面获取指定文件夹下面的该文件,赋值时间
File file = new File("Z:\\"+fileName);
SimpleDateFormat sdf = new SimpleDateFormat("dd-MMM-yyyy HH:mm",Locale.US);
if(file.setLastModified(sdf.parse(fileDate).getTime())){ //获取到文件的时间并赋值给已下载好的文件
System.out.println("success");
}
}
}