/**
* 保存查询京东订单的开始时间与结束时间
*
* @param startDate
* @param endTime
* @return
* @throws IOException
*/
public void saveDate(String startDate, String endTime) {
Properties pro = new Properties();
String propertiesName = "jdStoreSearchDate.properties";
String TMP_DIR = this.getClass().getClassLoader().getResource("/").getPath();
String fileUrl = TMP_DIR + propertiesName;
//重新写入配置文件
FileOutputStream file = null;
try {
file = new FileOutputStream(fileUrl);
pro.put("startDate", startDate);//开始时间
pro.put("endTime", endTime);//开始时间
pro.store(file, "系统配置修改");
file.getFD().sync();
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
file.close();
} catch (IOException e1) {
e1.printStackTrace();
}
}
System.out.println("保存开始时间和结束时间成功");
}