mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 16:59:51 +00:00
make number of tries configurable
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@204 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
4c6c4fa79b
commit
fe11283ff3
1 changed files with 6 additions and 2 deletions
|
@ -62,12 +62,16 @@ public final class ParserUtils
|
||||||
|
|
||||||
public static CharSequence scrape(final String url, final boolean isPost, final String request, String encoding, final boolean cookieHandling)
|
public static CharSequence scrape(final String url, final boolean isPost, final String request, String encoding, final boolean cookieHandling)
|
||||||
throws IOException
|
throws IOException
|
||||||
|
{
|
||||||
|
return scrape(url, isPost, request, encoding, cookieHandling, 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CharSequence scrape(final String url, final boolean isPost, final String request, String encoding, final boolean cookieHandling,
|
||||||
|
int tries) throws IOException
|
||||||
{
|
{
|
||||||
if (encoding == null)
|
if (encoding == null)
|
||||||
encoding = SCRAPE_DEFAULT_ENCODING;
|
encoding = SCRAPE_DEFAULT_ENCODING;
|
||||||
|
|
||||||
int tries = 3;
|
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue