code: public static void setURLStreamHandlerFactory ( URLStreamHandlerFactory factory ) {
          synchronized ( PROTOCOL_HANDLERS ) {
              if ( Handler.factory != null ) {
                  throw new IllegalStateException("URLStreamHandlerFactory already set.");
              }
              PROTOCOL_HANDLERS.clear();
              Handler.factory = factory;
          }
      }
docs: Sets the URL stream handler factory for the environment. This
  allows specification of the factory used in creating underlying
  stream handlers. This can be called once per JVM instance.
  
  @param factory
  The URL stream handler factory.