Added cookie manager for uptime survey.
This commit is contained in:
parent
893b54e013
commit
164498339d
1 changed files with 8 additions and 1 deletions
|
@ -19,6 +19,8 @@
|
||||||
package fr.devinsy.statoolinfos.uptime;
|
package fr.devinsy.statoolinfos.uptime;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.net.CookieHandler;
|
||||||
|
import java.net.CookieManager;
|
||||||
import java.net.HttpURLConnection;
|
import java.net.HttpURLConnection;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
|
@ -93,7 +95,7 @@ public class UptimeSurveyor
|
||||||
|
|
||||||
if ((result == 301) || (result == 302) || (result == 307) || (result == 308))
|
if ((result == 301) || (result == 302) || (result == 307) || (result == 308))
|
||||||
{
|
{
|
||||||
System.out.println("BOUND DETECTED " + currentURL.toString() + " -> " + location);
|
System.out.println(Thread.currentThread().getId() + " BOUND DETECTED " + currentURL.toString() + " -> " + location);
|
||||||
currentURL = new URL(location);
|
currentURL = new URL(location);
|
||||||
|
|
||||||
currentBound += 1;
|
currentBound += 1;
|
||||||
|
@ -153,6 +155,11 @@ public class UptimeSurveyor
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
//
|
||||||
|
CookieManager cookieManager = new CookieManager();
|
||||||
|
CookieHandler.setDefault(cookieManager);
|
||||||
|
|
||||||
|
//
|
||||||
ExecutorService pool = Executors.newFixedThreadPool(20);
|
ExecutorService pool = Executors.newFixedThreadPool(20);
|
||||||
for (Uptime uptime : result)
|
for (Uptime uptime : result)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue