private UserProfile removeUserProfile ( Session session , String userName , boolean broadcast ) throws Exception { Node profileNode ; try { profileNode = utils . getProfileNode ( session , userName ) ; } catch ( PathNotFoundException e ) { return null ; } UserProfile profile = readProfile ( userName , profileNode ) ; if ( broadcast ) { preDelete ( profile , broadcast ) ; } profileNode . remove ( ) ; session . save ( ) ; removeFromCache ( profile ) ; if ( broadcast ) { postDelete ( profile ) ; } return profile ; }
Remove user profile from storage .