String filePath = "C://upload/userimg/sss.jpg"
File filenew =new File(filePath);
if (!filenew.getParentFile().exists()) { //判断父目录是否存在
filenew.getParentFile().mkdirs(); //不存在则创建父目录
filenew.createNewFile();
}
转载请注明原文地址: https://mac.8miu.com/read-492166.html