File f = new File(fileExportPath); // D:/temp
if(!f.exists())
{
f.mkdir();
}
f.setWritable(true);
f.setExecutable(true);
String filePath = fileExportPath + File.separator;
try {
String Content="";
Content+="\"Title\",\"Description\",\"DueDate\",\"AssignedTo\"\n";
byte buf[] = Content.getBytes();
OutputStream fileOut = new FileOutputStream(filePath);
fileOut.write(buf);
fileOut.close();
}
OutputStream fileOut = new FileOutputStream(filePath);我在这一行得到错误
答案 0 :(得分:0)
“filePath”是目录名称。
String filePath = fileExportPath + File.separator;
必须将文件名添加到“filePath”。
String filePath = fileExportPath + File.separator + "fileName";