code: public static boolean isResourceLocalToServer(URI resourceUri, URI serverUri) {
          URI relativeUri = serverUri.relativize(resourceUri);
          return !relativeUri.isAbsolute();
      }
docs: Figure out whether the URI is actually local to the server. That is,
  it tells whether the resouce is controlled by the server.
  
  @param resourceUri
  @param serverUri   the server URI
  @return