viewing paste Unknown #21915 | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
package main;
 
import java.io.IOException;
import java.net.URL;
import java.net.URLConnection;
 
public class Mail {
    
    final String head = "https://www.pi-saar.de/projekte-bewerten/bewertung-aktivieren/";
    public void parse(String email) throws IOException{
        String link = email.substring(email.indexOf(head), email.indexOf("Mit"));
        openUrl(link);
    }
    
    public void openUrl(String link) throws IOException{
        System.setProperty("java.net.useSystemProxies", "true");
        URL url = new URL(link);
        URLConnection myURLConnection = url.openConnection();
        myURLConnection.connect();
    }
}
 
Viewed 973 times, submitted by Guest.