private void createHierarchy ( ) { for ( Map . Entry < String , FileDescriptor > entry : containedFiles . entrySet ( ) ) { String relativePath = entry . getKey ( ) ; FileDescriptor fileDescriptor = entry . getValue ( ) ; int separatorIndex = relativePath . lastIndexOf ( ' ' ) ; if ( separatorIndex != - 1 ) { String parentName = relativePath . substring ( 0 , separatorIndex ) ; FileDescriptor parentDescriptor = containedFiles . get ( parentName ) ; if ( parentDescriptor instanceof FileContainerDescriptor ) { ( ( FileContainerDescriptor ) parentDescriptor ) . getContains ( ) . add ( fileDescriptor ) ; } } } }
Build the hierarchy of the container entries i . e . add contains relations from containers to their children .