Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.28 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6.  
  7. package mhd;
  8.  
  9. import java.io.IOException;
  10. import java.net.MalformedURLException;
  11. import java.net.URL;
  12. import java.util.List;
  13. import org.jsoup.Jsoup;
  14. import org.jsoup.nodes.Document;
  15.  
  16. /**
  17.  *
  18.  * @author martrin100
  19.  */
  20. public class Parser2 {
  21.    
  22.     private final String url;
  23.     private Document doc;
  24.  
  25.     public Parser2(String url) {
  26.         this.url = url;
  27.         try {
  28.             Jsoup.parse(new URL(url), 1000 * 5);
  29.         }catch (MalformedURLException ex) {
  30.             throw new IllegalArgumentException(String.format("Mallformed URL:%s",url));
  31.                 }
  32.          catch (IOException ex) {
  33.             throw new IllegalArgumentException(String.format("IO excception occured while downloading:%s",url));
  34.         }
  35.     }
  36.    
  37.     public static class Zastavka{
  38.         public final String meno;
  39.         public final int cas;
  40.  
  41.         public Zastavka(String meno, int cas) {
  42.             this.meno = meno;
  43.             this.cas = cas;
  44.         }
  45.        
  46.        
  47.     }
  48.    
  49.    
  50.     public List<Zastavka> parseZastavky(){
  51.         return null;
  52.     }
  53.    
  54.    
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement