specify timeouts

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@48 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach 2010-08-07 14:06:27 +00:00
parent 26e3a2fec3
commit 8c8184cd0e

View file

@ -53,6 +53,8 @@ public final class ParserUtils
final URLConnection connection = new URL(url).openConnection();
connection.setDoInput(true);
connection.setDoOutput(request != null);
connection.setConnectTimeout(5000);
connection.setReadTimeout(5000);
connection.addRequestProperty("User-Agent", SCRAPE_USER_AGENT);
if (request != null)