public class FakeBrowser extends Object
Constructor and Description |
---|
FakeBrowser() |
Modifier and Type | Method and Description |
---|---|
void |
addProperty(String name,
String value)
Adds a property to the request (e.g., a cookie..)
|
Reader |
fetch(String url)
Fetches the url and returns a reader with the content of the page.
|
Reader |
fetch(URL url)
Fetches the url and returns a reader with the content of the page.
|
StringBuilder |
fetchAsString(String url)
Fetches the url and returns a string with the content of the page.
|
public Reader fetch(URL url) throws IOException
url
- the url to fetch.IOException
- if an errors occurs during the fetching.public void addProperty(String name, String value)
name
- the name fo the propertyvalue
- the value of the propertypublic Reader fetch(String url) throws IOException
url
- the url to fetch.IOException
- if an errors occurs during the fetching.public StringBuilder fetchAsString(String url) throws IOException
url
- the url to fetch.IOException
- if an errors occurs during the fetching.Copyright © 2013. All rights reserved.