如何创建目录/文件夹?
一旦我考了System.getProperty("user.home");
分
当且仅当新文件夹不存在时,我必须创建一个目录(目录名为"new folder").
如何创建目录/文件夹?
一旦我考了System.getProperty("user.home");
分
当且仅当新文件夹不存在时,我必须创建一个目录(目录名为"new folder").
大约7年后,我会把它更新到Bozho个人建议的更好的方法.
File theDir = new File("/path/directory");
if (!theDir.exists()){
theDir.mkdirs();
}