if (!file.exists())
try {
file.createNewFile();
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
if (!file.exists()) //判断文件是否存在,!file.exists()条件是说文件不存在。
try {
file.createNewFile(); // 不存在就创建
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}流的那张说的很清楚