建立多级文件夹

// 创建多级文件夹

public static void createDirectory(String path) throws Exception {
if (StringUtils.isNullOrEmpty(path)) {
return;
}
try {
// 获得文件对象
File f = new File(path);
if (!f.exists()) {
// 如果路径不存在,则创建
f.mkdirs();
}
} catch (Exception e) {
throw e;
}
}

posted @ 2016-12-02 19:06  1582277142  阅读(298)  评论(0)    收藏  举报