code: public void assertLocalClient() {
      NetworkInterface iface = null;
      try {
        iface = NetworkInterface.getByInetAddress(getInetAddress());
      } catch (java.net.SocketException se) {
        throw (new SecurityException("Unable to determine if client is local.  Assuming he isn't."));
      }
  
      if ((iface == null) && (!getInetAddress().isLoopbackAddress())) {
        throw (new SecurityException("Client is not local."));
      }
    }
docs: Throws a <code>java.lang.SecurityException</code> if the client is not connected from the local
  machine.