protected ItemImpl readItem ( ItemData itemData , NodeData parent , boolean pool , boolean apiRead ) throws RepositoryException { if ( ! apiRead ) { // Need privileges SecurityManager security = System . getSecurityManager ( ) ; if ( security != null ) { security . checkPermission ( JCRRuntimePermissions . INVOKE_INTERNAL_API_PERMISSION ) ; } } if ( itemData != null ) { ItemImpl item ; ItemImpl pooledItem ; if ( pool && ( pooledItem = itemsPool . get ( itemData , parent ) ) != null ) { // use pooled & reloaded item = pooledItem ; } else { // create new item = itemFactory . createItem ( itemData , parent ) ; } if ( apiRead ) { if ( ! item . hasPermission ( PermissionType . READ ) ) { throw new AccessDeniedException ( "Access denied " + itemData . getQPath ( ) . getAsString ( ) + " for " + session . getUserID ( ) ) ; } session . getActionHandler ( ) . postRead ( item ) ; } return item ; } else { return null ; } }
Create or reload pooled ItemImpl with the given ItemData .