question: private boolean pathMatch ( URL realmUrl , URL returnToUrl ) { String realmPath = realmUrl . getPath ( ) ; String returnToPath = returnToUrl . getPath ( ) ; if ( ! realmPath . endsWith ( "/" ) ) realmPath += "/" ; if ( ! returnToPath . endsWith ( "/" ) ) returnToPath += "/" ; return returnToPath . startsWith ( realmPath ) ; }
target:  Does the URL's path equal to or a sub-directory of the realm's path.