public MemoryFileAttributes addDir ( EightyPath dir , Principals principals ) { if ( content . get ( dir ) . isPresent ( ) ) { throw new IllegalArgumentException ( "path exists already" ) ; } if ( ! dir . isAbsolute ( ) || dir . getParent ( ) == null ) { throw new IllegalArgumentException ( "path not absolute or without parent" ) ; } PathContent parentContent = content . getOrThrow ( childGetParent ( dir ) , ( ) -> new IllegalArgumentException ( "parent does not exist" ) ) ; content . put ( dir , PathContent . newDir ( principals ) ) ; parentContent . kids . add ( dir ) ; parentContent . attis . setLastModifiedTime ( ) ; parentContent . attis . setLastAccessTime ( ) ; return parentContent . attis ; }
todo default to root ?