Package org.htmlunit
Class TextPage
- java.lang.Object
-
- org.htmlunit.AbstractPage
-
- org.htmlunit.TextPage
-
- All Implemented Interfaces:
java.io.Serializable
,Page
public class TextPage extends AbstractPage
A generic page that will be returned for any text related content. Specifically any content types that start withtext/
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TextPage(WebResponse webResponse, WebWindow enclosingWindow)
Creates an instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getContent()
Returns the content of this page.void
save(java.io.File file)
Saves the content of this page to a text file.-
Methods inherited from class org.htmlunit.AbstractPage
cleanUp, getEnclosingWindow, getUrl, getWebResponse, initialize, isHtmlPage
-
-
-
-
Constructor Detail
-
TextPage
public TextPage(WebResponse webResponse, WebWindow enclosingWindow)
Creates an instance.- Parameters:
webResponse
- the response from the serverenclosingWindow
- the window that holds the page
-
-
Method Detail
-
getContent
public java.lang.String getContent()
Returns the content of this page.- Returns:
- the content of this page
-
save
public void save(java.io.File file) throws java.io.IOException
Saves the content of this page to a text file.- Parameters:
file
- file to write this page into- Throws:
java.io.IOException
- If an error occurs
-
-