1 6 package fr.jayasoft.ivy.url; 7 8 import fr.jayasoft.ivy.util.Message; 9 10 14 public class URLHandlerRegistry { 15 private static URLHandler _default = new BasicURLHandler(); 16 17 public static URLHandler getDefault() { 18 return _default; 19 } 20 public static void setDefault(URLHandler def) { 21 _default = def; 22 } 23 24 32 public static URLHandler getHttp() { 33 try { 34 Class.forName("org.apache.commons.httpclient.HttpClient"); 35 Message.verbose("jakarta commons httpclient detected: using it for http downloading"); 36 return new HttpClientHandler(); 37 } catch (ClassNotFoundException e) { 38 Message.verbose("jakarta commons httpclient not found: using jdk url handling"); 39 return new BasicURLHandler(); 40 } 41 } 42 43 } 44 | Popular Tags |