/**
* SPDXVersion: SPDX-1.1 Creator: Person: Nuno Brito (nuno.brito@triplecheck.de)
* Creator: Organization: TripleCheck (http://triplecheck.de) Created:
* 2013-12-08T00:00:00Z LicenseName: NOASSERTION FileName: Test.java FileType:
* SOURCE FileCopyrightText: <text> Copyright (c) 2013 Nuno Brito, TripleCheck
* </text>
* FileComment: <text> </text>
*/
package main;
/**
*
* @author Nuno Brito, 8th of December 2013 in Darmstadt, Germany.
*/
public class Test {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
String test = utils.html.redirect("/basic/status", 0);
//System.out.println(test);
String URL = "";
String delay = "";
String beacon = "http-equiv=\"refresh\"";
String beacon2 = "content=\"";
String beacon3 = "url=";
String text = test.toLowerCase();
if(text.contains(beacon)){
// get the beginning of the text
int pos1 = text.indexOf(beacon);
String s1 = text.substring(pos1 + beacon.length());
int pos2 = s1.indexOf(beacon3);
int pos3 = s1.indexOf("\">");
String s2 = s1.substring(pos2 + beacon3.length(), pos3);
// // get the beginning of the text
// int pos1 = text.indexOf(beacon);
// String s1 = text.substring(pos1 + beacon.length());
// // get the delay
// int pos2 = s1.indexOf(beacon2);
// String s2 = s1.substring(pos2 + beacon2.length());
// int pos3 = s2.indexOf(";");
// delay = s2.substring(0, pos3);
// // get the URL
// pos1 = s2.indexOf(beacon3);
// pos2 = s2.indexOf("\">");
// URL = s2.substring(pos1 + beacon3.length(), pos2);
System.out.println(delay +"->" + URL + "\n" + s2);
}
}
}