code: public static synchronized void setContentHandlerFactory(ContentHandlerFactory fac) {
          if (factory != null) {
              throw new Error("factory already defined");
          }
          SecurityManager security = System.getSecurityManager();
          if (security != null) {
              security.checkSetFactory();
          }
          factory = fac;
      }
docs: Sets the <code>ContentHandlerFactory</code> of an
  application. It can be called at most once by an application.
  <p>
  The <code>ContentHandlerFactory</code> instance is used to
  construct a content handler from a content type
  <p>
  If there is a security manager, this method first calls
  the security manager's <code>checkSetFactory</code> method
  to ensure the operation is allowed.
  This could result in a SecurityException.
  
  @param      fac   the desired factory.
  @exception  Error  if the factory has already been defined.
  @exception  SecurityException  if a security manager exists and its
  <code>checkSetFactory</code> method doesn't allow the operation.
  @see        java.net.ContentHandlerFactory
  @see        java.net.URLConnection#getContent()
  @see        SecurityManager#checkSetFactory