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