Back to project page wizapp.
The source code is released under:
MIT License
If you think the Android project wizapp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.wb.wizapp.rest; /*from w w w.j a v a 2s .c om*/ import java.util.HashMap; import java.util.Map; import org.apache.http.HttpHost; import android.net.Uri; public class RestAPIHostFactory { private static Map<String, RestAPIHost> hostCache = new HashMap<String, RestAPIHost>(); public synchronized static RestAPIHost getHost(String url) { Uri uri = Uri.parse(url); String host = uri.getHost(); RestAPIHost apiHost = hostCache.get(host); if (apiHost == null) { apiHost = new RestAPIHost(new HttpHost(uri.getHost(), uri.getPort(), uri.getScheme())); hostCache.put(host, apiHost); } return apiHost; } }