* @param maxThreads - number of requests to make in parallel. Should be 1 to 100?
* @param userAgent - what to use when making requests.
* @return BaseFetcher that can be passed to the UrlLengthener constructor.
*/
public static BaseFetcher makeFetcher(int maxThreads, UserAgent userAgent) {
FetcherPolicy policy = new FetcherPolicy();
policy.setRedirectMode(RedirectMode.FOLLOW_NONE);
policy.setMaxRedirects(MAX_REDIRECTS);
policy.setMaxConnectionsPerHost(maxThreads);
SimpleHttpFetcher result = new SimpleHttpFetcher(maxThreads, policy, userAgent);
result.setDefaultMaxContentSize(MAX_CONTENT_SIZE);
// We don't want any encoding (compression) of the data.