code: public static int getPort(final URI uri) throws NormalizationException {
          if (hasPort(uri)) {
              return uri.getPort();
          }
          
          Integer port = NetProtocol.find(getScheme(uri)).getPort();
          if (null == port) {
          	throw new NormalizationException(uri.toString(), "Cannot determine port");
          }
          
          return port;
      }
docs: Returns the port of the given URI.  If not specified, it returns the default port based on scheme.  If the
  default port cannot be determined, then it throws an exception.
  
  @param uri the URI to extract the port from
  @return the extracted port
  @throws NormalizationException if there is no port, and we cannot determine a default.