1 11 12 package org.eclipse.update.internal.core.connection; 13 14 import java.io.IOException ; 15 import java.net.URL ; 16 17 public class ConnectionFactory { 18 19 20 public static IResponse get(URL url) throws IOException { 21 IResponse response = null; 23 24 if ("file".equals(url.getProtocol())) { response = new FileResponse(url); 26 } else if (url != null && url.getProtocol().startsWith("http")) { response = new HttpResponse(url); 28 } else { 29 response = new OtherResponse(url); 30 } 31 32 return response; 33 } 34 } 35 | Popular Tags |