This is a good idea in this way we favour exceptions instead of custom returns such as null.
On 5 September 2011 22:02, Oleg Kalnichevski (JIRA) <[email protected]> wrote: > > [ > https://issues.apache.org/jira/browse/HTTPCLIENT-1123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13097254#comment-13097254 > ] > > Oleg Kalnichevski commented on HTTPCLIENT-1123: > ----------------------------------------------- > > Almost there. I think it would be better if the DnsResolver was always to > resolve hostname to an address or throw an UnknownHostException if the > address could not be resolved instead of returning null. Individual > implementations may choose to fall back onto InetAddress#getAllByName when > appropriate or signal failure to resolve the hostname by throwing > UnknownHostException. > --- > public interface DnsResolver { > > InetAddress[] resolve(String host) throws UnknownHostException; > > } > --- > What do you think? > > Oleg > >> Implement a way to override or resolve DNS entries defined in the OS >> -------------------------------------------------------------------- >> >> Key: HTTPCLIENT-1123 >> URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1123 >> Project: HttpComponents HttpClient >> Issue Type: New Feature >> Components: HttpClient >> Reporter: Alin Vasile >> Priority: Minor >> Attachments: dns_overrider_poc.patch, dns_overrider_poc.patch, >> dns_resolver.patch, dns_resolver.patch >> >> >> When working with HttpClient in restrictive environments, where the user >> doesn't have the permissisions to edit the local /etc/hosts file or the DNS >> configuration, can be eased with an DNS Overrider capability. >> This can be useful with JMeter which can follow redirects automatically and >> resolve some of the redirected hosts against its configuration. Another >> example is a custom forward proxy, written in Java and based on httpclient, >> which can be deployed is such a restricted environment that would ease the >> development of various web solutions for some developers. > > -- > This message is automatically generated by JIRA. > For more information on JIRA, see: http://www.atlassian.com/software/jira > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
