private static ParsedNamingURL parseURL(String str) throws MalformedURLException {
  try {
    return intParseURL(str);
  }
 catch (  URISyntaxException ex) {
    MalformedURLException mue=new MalformedURLException("invalid URL String: " + str);
    mue.initCause(ex);
    int indexSchemeEnd=str.indexOf(':');
    int indexAuthorityBegin=str.indexOf("//:");
    if (indexAuthorityBegin < 0) {
      throw mue;
    }
    if ((indexAuthorityBegin == 0) || ((indexSchemeEnd > 0) && (indexAuthorityBegin == indexSchemeEnd + 1))) {
      int indexHostBegin=indexAuthorityBegin + 2;
      String newStr=str.substring(0,indexHostBegin) + "localhost" + str.substring(indexHostBegin);
      try {
        return intParseURL(newStr);
      }
 catch (      URISyntaxException inte) {
        throw mue;
      }
catch (      MalformedURLException inte) {
        throw inte;
      }
    }
    throw mue;
  }
}

private static ParsedNamingURL parseURL ( String str ) throws MalformedURLException { try { return intParseURL ( str ) ; } catch ( URISyntaxException ex ) { MalformedURLException mue = new MalformedURLException ( "invalid URL String: " + str ) ; mue . initCause ( ex ) ; int indexSchemeEnd = str . indexOf ( ':' ) ; int indexAuthorityBegin = str . indexOf ( "//:" ) ; if ( indexAuthorityBegin < 0 ) { throw mue ; } if ( ( indexAuthorityBegin == 0 ) || ( ( indexSchemeEnd > 0 ) && ( indexAuthorityBegin == indexSchemeEnd + 1 ) ) ) { int indexHostBegin = indexAuthorityBegin + 2 ; String newStr = str . substring ( 0 , indexHostBegin ) + "localhost" + str . substring ( indexHostBegin ) ; try { return intParseURL ( newStr ) ; } catch ( URISyntaxException inte ) { throw mue ; } catch ( MalformedURLException inte ) { throw inte ; } } throw mue ; } }
dissect naming url strings to obtain referenced host , port and object name .
