/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package koeaikataulu;

import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;

import java.util.Scanner;

class WebHakija {

     
    static WebSivu hae(String osoite) throws MalformedURLException, IOException {
        URL url = new URL(osoite);               
        Scanner l = new Scanner(url.openStream());        
        String sisalto = "";
        
        while (l.hasNext()) {
            sisalto += l.nextLine() + "\n";
        }
        
        return new WebSivu(sisalto);
    }

}
