List of usage examples for org.apache.commons.httpclient.cookie CookiePolicy IGNORE_COOKIES
String IGNORE_COOKIES
To view the source code for org.apache.commons.httpclient.cookie CookiePolicy IGNORE_COOKIES.
Click Source Link
From source file:edu.unc.lib.dl.ui.service.XMLRetrievalService.java
public static Document getXMLDocument(String url) throws HttpException, IOException, JDOMException { SAXBuilder builder = new SAXBuilder(); HttpClient client = new HttpClient(); HttpMethod method = new GetMethod(url); method.getParams().setParameter("http.socket.timeout", new Integer(2000)); method.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES); method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(3, false)); method.getParams().setParameter("http.useragent", ""); InputStream responseStream = null; Document document = null;//from w w w . j a va2 s . com try { client.executeMethod(method); responseStream = method.getResponseBodyAsStream(); document = builder.build(responseStream); } finally { if (responseStream != null) responseStream.close(); method.releaseConnection(); } return document; }
From source file:cn.edu.seu.herald.ws.api.impl.ServiceRequesterFactory.java
HttpClient newServiceRequester() {
HttpClient serviceRequester = new HttpClient();
serviceRequester.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES);
return serviceRequester;
}
From source file:com.google.step2.example.provider.GuiceModule.java
@Override protected void configure() { try {/*ww w . j ava2s. com*/ Message.addExtensionFactory(AxMessage2.class); } catch (MessageException e) { throw new CreationException(null); } try { Message.addExtensionFactory(HybridOauthMessage.class); } catch (MessageException e) { throw new CreationException(null); } bind(ConsumerAssociationStore.class).to(InMemoryConsumerAssociationStore.class).in(Scopes.SINGLETON); bind(ConsumerManager.class).toProvider(ConsumerManagerProvider.class).in(Scopes.SINGLETON); bind(HttpClient.class).toInstance( HttpClientFactory.getInstance(0, Boolean.FALSE, 10000, 10000, CookiePolicy.IGNORE_COOKIES)); }
From source file:com.tasktop.c2c.server.common.web.server.AvatarImageController.java
public AvatarImageController() { client.getHttpConnectionManager().getParams().setConnectionTimeout(avatarRequestTimeout); client.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES); }
From source file:net.sf.j2ep.servers.ServerStatusChecker.java
/** * Basic constructor sets the listener to notify when * servers goes down/up. Also sets the polling time * which decides how long we wait between doing checks. * //from www. j a v a 2 s .c om * @param listener The listener * @param pollingTime The time we wait between checks, in milliseconds */ public ServerStatusChecker(ServerStatusListener listener, long pollingTime) { this.listener = listener; this.pollingTime = Math.max(30 * 1000, pollingTime); setPriority(Thread.NORM_PRIORITY - 1); setDaemon(true); online = new LinkedList(); offline = new LinkedList(); httpClient = new HttpClient(); httpClient.getParams().setBooleanParameter(HttpClientParams.USE_EXPECT_CONTINUE, false); httpClient.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES); }
From source file:com.google.step2.example.consumer.GuiceModule.java
@Override protected void configure() { try {/*from www.j a va 2 s . c o m*/ Message.addExtensionFactory(AxMessage2.class); } catch (MessageException e) { throw new CreationException(null); } try { Message.addExtensionFactory(HybridOauthMessage.class); } catch (MessageException e) { throw new CreationException(null); } bind(ConsumerAssociationStore.class).to(InMemoryConsumerAssociationStore.class).in(Scopes.SINGLETON); bind(ConsumerManager.class).toProvider(ConsumerManagerProvider.class).in(Scopes.SINGLETON); bind(HttpClient.class).toInstance( HttpClientFactory.getInstance(0, Boolean.FALSE, 10000, 10000, CookiePolicy.IGNORE_COOKIES)); bind(OAuthClient.class).toInstance(getOAuthClient()); bind(OAuthProviderInfoStore.class).to(SimpleProviderInfoStore.class).in(Scopes.SINGLETON); /* * customizations for new-style discovery */ // we're using a ParallelHostMetaFetcher to fetch host-metas both from their // default location, and from a special location at Google. bind(HostMetaFetcher.class).toProvider(HostMetaFetcherProvider.class).in(Scopes.SINGLETON); // we're using a cert validator that will validate certs either if they // belong to the expected signer of the XRD, or if they're signed // by Google. bind(CertValidator.class).toProvider(CertValidatorProvider.class).in(Scopes.SINGLETON); }
From source file:com.tasktop.c2c.server.web.proxy.HttpProxy.java
public HttpProxy() { httpClient = new HttpClient(new MultiThreadedHttpConnectionManager()); httpClient.getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES); httpClient.getHttpConnectionManager().getParams().setSoTimeout(60 * 1000); httpClient.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new DefaultHttpMethodRetryHandler(0, false)); }
From source file:fr.unix_experience.owncloud_sms.engine.OCHttpClient.java
public OCHttpClient(Context context, Uri serverURI, String accountName, String accountPassword) { super(new MultiThreadedHttpConnectionManager()); Protocol easyhttps = new Protocol("https", (ProtocolSocketFactory) new EasySSLProtocolSocketFactory(), 443); Protocol.registerProtocol("https", easyhttps); _serverURI = serverURI;//w ww .ja v a 2 s . c o m _username = accountName; _password = accountPassword; getParams().setParameter(HttpClientParams.ALLOW_CIRCULAR_REDIRECTS, true); getParams().setParameter(PARAM_PROTOCOL_VERSION, HttpVersion.HTTP_1_1); getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES); getParams().setParameter(HttpMethodParams.USER_AGENT, "nextcloud-phonesync (" + new AndroidVersionProvider(context).getVersionCode() + ")"); }
From source file:ir.keloud.android.lib.common.KeloudClient.java
/** * Constructor/* w w w. j a v a2 s.co m*/ */ public KeloudClient(Uri baseUri, HttpConnectionManager connectionMgr) { super(connectionMgr); if (baseUri == null) { throw new IllegalArgumentException("Parameter 'baseUri' cannot be NULL"); } mBaseUri = baseUri; mInstanceNumber = sIntanceCounter++; Log_OC.d(TAG + " #" + mInstanceNumber, "Creating KeloudClient"); String userAgent = KeloudClientManagerFactory.getUserAgent(); getParams().setParameter(HttpMethodParams.USER_AGENT, userAgent); getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1); getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES); getParams().setParameter(PARAM_SINGLE_COOKIE_HEADER, // to avoid problems with some web servers PARAM_SINGLE_COOKIE_HEADER_VALUE); applyProxySettings(); clearCredentials(); }
From source file:com.owncloud.android.oc_framework.network.webdav.WebdavClient.java
public void setSsoSessionCookie(String accessToken) { getParams().setAuthenticationPreemptive(false); getParams().setCookiePolicy(CookiePolicy.IGNORE_COOKIES); mSsoSessionCookie = accessToken;// w w w .ja v a2s. c o m mCredentials = null; }