
com.star.net.http.CookiePool Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of utils Show documentation
Show all versions of utils Show documentation
some utility class for java develop
The newest version!
package com.star.net.http;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* cookie池 做缓存用
*
* @author http://git.oschina.net/loolly/hutool
*/
public final class CookiePool {
/**
* key: host, value: cookies字符串
*/
private static Map cookies = new ConcurrentHashMap<>();
private CookiePool() {
}
/**
* 获得某个网站的Cookie信息
*
* @param host 主机
* @return cookie信息
*/
public static String get(final String host) {
return cookies.get(host);
}
/**
* 将某个网站的Cookie放入Cookie池
*
* @param host 主机
* @param cookie cookie信息
*/
public static void put(final String host, final String cookie) {
cookies.put(host, cookie);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy