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);
}

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 ) ; }
does the url ' s path equal to or a sub - directory of the realm ' s path .
