src/org/nutz/lang/Files.java
public static File createDirIfNoExists(File d) {
        if (null == d)
            return d;
        if (!d.exists()) {
            if (!Files.makeDir(d)) {
                throw Lang.makeThrow("fail to create '%s', permission deny?", d.getAbsolutePath());
            }
        }
        if (!d.isDirectory())
            throw Lang.makeThrow("'%s' should be a directory!", d);
        return d;
    }
public static File createDirIfNoExists(File d) {
        if (null == d)
            return d;
        if (!d.exists()) {
            if (!Files.makeDir(d)) {
                throw Lang.makeThrow("fail to create '%s', permission deny?", d.getAbsolutePath());
            }
        }
        if (!d.isDirectory())
            throw Lang.makeThrow("'%s' should be a directory!", d);
        return d;
    }
public static File createDirIfNoExists ( File d ) { if ( null == d ) return d ; if ( ! d . exists ( ) ) { if ( ! Files . makeDir ( d ) ) { throw Lang . makeThrow ( "fail to create '%s', permission deny?" , d . getAbsolutePath ( ) ) ; } } if ( ! d . isDirectory ( ) ) throw Lang . makeThrow ( "'%s' should be a directory!" , d ) ; return d ; }
传入一个目录对象，如果目录不存在，则创建目录

@param d
文件目录对象
@return 文件目录对象，以便调用者省略一行代码
传入一个目录对象，如果目录不存在，则创建目录