public static DnsUrl[] fromList(String urlList) throws MalformedURLException {
  DnsUrl[] urls=new DnsUrl[(urlList.length() + 1) / 2];
  int i=0;
  StringTokenizer st=new StringTokenizer(urlList," ");
  while (st.hasMoreTokens()) {
    urls[i++]=new DnsUrl(st.nextToken());
  }
  DnsUrl[] trimmed=new DnsUrl[i];
  System.arraycopy(urls,0,trimmed,0,i);
  return trimmed;
}

public static DnsUrl [ ] fromList ( String urlList ) throws MalformedURLException { DnsUrl [ ] urls = new DnsUrl [ ( urlList . length ( ) + 1 ) / 2 ] ; int i = 0 ; StringTokenizer st = new StringTokenizer ( urlList , " " ) ; while ( st . hasMoreTokens ( ) ) { urls [ i ++ ] = new DnsUrl ( st . nextToken ( ) ) ; } DnsUrl [ ] trimmed = new DnsUrl [ i ] ; System . arraycopy ( urls , 0 , trimmed , 0 , i ) ; return trimmed ; }
given a space - separated list of dns urls , returns an array of dnsurl objects .
