@ Override public boolean mkdirs ( Path hadoopPath , FsPermission permission ) throws IOException { long startTime = System . nanoTime ( ) ; Preconditions . checkArgument ( hadoopPath != null , "hadoopPath must not be null" ) ; checkOpen ( ) ; logger . atFine ( ) . log ( "GHFS.mkdirs: %s, perm: %s" , hadoopPath , permission ) ; URI gcsPath = getGcsPath ( hadoopPath ) ; try { getGcsFs ( ) . mkdirs ( gcsPath ) ; } catch ( java . nio . file . FileAlreadyExistsException faee ) { // Need to convert to the Hadoop flavor of FileAlreadyExistsException. throw ( FileAlreadyExistsException ) new FileAlreadyExistsException ( faee . getMessage ( ) ) . initCause ( faee ) ; } long duration = System . nanoTime ( ) - startTime ; increment ( Counter . MKDIRS ) ; increment ( Counter . MKDIRS_TIME , duration ) ; return true ; }
Makes the given path and all non - existent parents directories . Has the semantics of Unix mkdir - p .