populateFromFile

void proxyServerPool.populateFromFile ( String filePath )

Description

Add proxy servers to pool using a text file.

Parameters

  • filePath Path to the file containing proxy settings, as a string. The format of the file is a hard return delimited list of domain:port listing.

Return Values

Returns void.

Change Log

Version Description
4.5 Available for all editions.

Examples

Creating ProxyServerPool

 import com.screenscraper.util.*;

 // Create a new ProxyServerPool object. This object will
 // control how screen-scraper interacts with proxy servers.

 proxyServerPool = new ProxyServerPool();

 // Must be set on the session before other calls are made
 session.setProxyServerPool(proxyServerPool);

 // This tells the pool to populate itself from a file
 // containing a list of proxy servers. The format is very
 // simple--you should have a proxy server on each line of
 // the file, with the host separated from the port by a colon.
 // For example:
 // one.proxy.com:8888
 // two.proxy.com:3128
 // 29.283.928.10:8080
 // But obviously without the slashes at the beginning.

 proxyServerPool.populateFromFile( "proxies.txt" );