humble-video-noarch/src/main/java/io/humble/video/customio/URLProtocolManager.java
public IURLProtocolHandler getHandler(String url, int flags)
  {
    IURLProtocolHandler result = null;

    log.trace("looking for protocol handler for: {}", url);
    if (url == null || url.length() == 0)
      throw new IllegalArgumentException("expected valid URL");
    int colonIndex = url.indexOf(":");
    String protocol = null;
    if (colonIndex > 0)
    {
      protocol = url.substring(0, colonIndex);
    }
    else
    {
      protocol = DEFAULT_PROTOCOL;
    }

    IURLProtocolHandlerFactory factory = mProtocols.get(protocol);
    if (factory != null)
    {
      result = factory.getHandler(protocol, url, flags);
    }
    else
    {
      log.error("asked to get handler for unsupported protocol: {}",
          protocol);
    }

    return result;
  }
public IURLProtocolHandler getHandler(String url, int flags)
  {
    IURLProtocolHandler result = null;

    log.trace("looking for protocol handler for: {}", url);
    if (url == null || url.length() == 0)
      throw new IllegalArgumentException("expected valid URL");
    int colonIndex = url.indexOf(":");
    String protocol = null;
    if (colonIndex > 0)
    {
      protocol = url.substring(0, colonIndex);
    }
    else
    {
      protocol = DEFAULT_PROTOCOL;
    }

    IURLProtocolHandlerFactory factory = mProtocols.get(protocol);
    if (factory != null)
    {
      result = factory.getHandler(protocol, url, flags);
    }
    else
    {
      log.error("asked to get handler for unsupported protocol: {}",
          protocol);
    }

    return result;
  }
/*
Get a IURLProtocolHandler for this url.
<p>
IMPORTANT: This function is called from native code, and so the name and signature cannot
change without changing the native code.
</p><p>
This function is eventually invoked whenever someone tries to call url_open("yourprotocol:...", flags)
from FFMPEG native code.  It returns a protocol handler which will then have open(...) called on it.
</p>
@param url The URL we want to handle.
@param flags   Any flags that the url_open() function will want to pass.

@returns A protocol handler to use.