viewing paste Unknown #21914 | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
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{
        URL url = new URL(link);
        URLConnection myURLConnection = url.openConnection();
        myURLConnection.connect();
    }
}
 
Viewed 1017 times, submitted by Guest.