Code example for BasicCookieStore

Methods: addCookie

0
        private HttpEntity getRemoteImage(HttpClientManager manager, String cookie)
                throws IOException { 
            // 이미지를 Cache할 경로를 설정하지 않은 경우에는 다운로드만 받고 종료한다. 
            HttpResponse response = null;
            if (cookie != null) {
                CookieStore cookies = new BasicCookieStore();
                cookies.addCookie(new BasicClientCookie("cookie", cookie));
                response = manager.sendGet(url, cookies);
            } else { 
                response = manager.sendGet(url);
            } 
            final int statusCode = response.getStatusLine().getStatusCode();
            if (statusCode != HttpStatus.SC_OK) {
                if (Logger.isWarnEnabled()) { 
                    Logger.w(getClass(), "Error " + statusCode
                            + " while retrieving bitmap from " + url);
                } 
                return null; 
            } 
            // 이미지인지 여부를 확인한다. 
Stop searching for code, let great code find you!  Add Codota to your java IDE