crowdwalk/src/main/java/nodagumi/Itk/Itk.java
/**
     * ensure dir exists.
     * @param path : path of directory / file.
     * @param checkParent : true if path is an actual file path.
     *                If false, path is considered as dir path.
     */
ensure dir exists.
@param path : path of directory / file.
@param checkParent : true if path is an actual file path.
If false, path is considered as dir path.
ensure dir exists . @param path : path of directory / file . @param checkParent : true if path is an actual file path . If false path is considered as dir path .
final static public boolean ensureDirExists(String path,
                                                boolean checkParent) {
        if(checkParent) {
            path = new File(path).getParent() ;
        }
        File dir = new File(path) ;
        if(! dir.exists()) {
            Itk.logWarn("Itk.ensureDirExists()",
                        "The directory is not exists. Create it.:",
                        path) ;
            dir.mkdir() ;
            return true ;
        } else {
            return false ;
        }
    }
final static public boolean ensureDirExists ( String path , boolean checkParent ) { if ( checkParent ) { path = new File ( path ) . getParent ( ) ; } File dir = new File ( path ) ; if ( ! dir . exists ( ) ) { Itk . logWarn ( "Itk.ensureDirExists()" , "The directory is not exists. Create it.:" , path ) ; dir . mkdir ( ) ; return true ; } else { return false ; } }
ensure dir exists.
ensure dir exists .