@ VisibleForTesting public void mkdir ( URI path ) throws IOException { logger . atFine ( ) . log ( "mkdir(%s)" , path ) ; Preconditions . checkNotNull ( path ) ; checkArgument ( ! path . equals ( GCS_ROOT ) , "Cannot create root directory." ) ; StorageResourceId resourceId = pathCodec . validatePathAndGetId ( path , true ) ; // If this is a top level directory, create the corresponding bucket. if ( resourceId . isBucket ( ) ) { gcs . create ( resourceId . getBucketName ( ) ) ; return ; } // Ensure that the path looks like a directory path. resourceId = FileInfo . convertToDirectoryPath ( resourceId ) ; // Not a top-level directory, create 0 sized object. gcs . createEmptyObject ( resourceId ) ; tryUpdateTimestampsForParentDirectories ( ImmutableList . of ( path ) , ImmutableList . < URI > of ( ) ) ; }
Creates a directory at the specified path .