package org.lodder.subtools.sublibrary.data;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.Map;

import org.lodder.subtools.sublibrary.Manager;
import org.lodder.subtools.sublibrary.ManagerException;
import org.lodder.subtools.sublibrary.ManagerSetupException;
import org.lodder.subtools.sublibrary.util.http.HttpClientException;

public class Html {

  private Manager manager;
  private String userAgent;

  public Html(Manager manager) {
    this.manager = manager;
    this.userAgent = "";
  }

  public Html(Manager manager, String userAgent) {
    this.manager = manager;
    this.userAgent = userAgent;
  }

  public void setUserAgent(String userAgent) {
    this.userAgent = userAgent;
  }

  public String getHtml(String url) throws MalformedURLException, IOException, HttpClientException,
      ManagerSetupException, ManagerException {
    return manager.getContent(url, userAgent, false);
  }

  public String getHtmlDisk(String url) throws MalformedURLException, IOException,
      HttpClientException, ManagerSetupException, ManagerException {
    return manager.getContent(url, userAgent, false);
  }

  public String postHtml(String url, Map<String, String> data) throws ManagerException {
    return manager.post(url, userAgent, data);
  }
}

@@ -393,17 +393,19 @@
 s Html %7B
-%0A
+%0D%0A%0D
 %0A  priva
@@ -423,16 +423,17 @@
 manager;
+%0D
 %0A  priva
@@ -803,39 +803,16 @@
 ) throws
- MalformedURLException,
  IOExcep
@@ -1000,31 +1000,8 @@
 rows
- MalformedURLException,
  IOE
@@ -1141,16 +1141,17 @@
 ;%0D%0A  %7D%0D%0A
+%0D
 %0A  publi
@@ -1231,16 +1231,17 @@
 eption %7B
+%0D
 %0A    ret

Remove duplicate throw