Package org.htmlunit

# Class TextPage

java.lang.Object
org.htmlunit.AbstractPage
org.htmlunit.TextPage

All Implemented Interfaces:
  `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 with `text/`

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TextPage(WebResponse webResponse, WebWindow enclosingWindow)`
  Creates an instance.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getContent()`
  Returns the content of this page.
  `void`
  `save(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`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TextPage

    public TextPage(WebResponse webResponse, WebWindow enclosingWindow)
    Creates an instance.
    Parameters:
      `webResponse` - the response from the server
      `enclosingWindow` - the window that holds the page

- ## Method Details

  - ### getContent

    public String getContent()
    Returns the content of this page.
    Returns:
      the content of this page

  - ### save

    public void save(File file) throws IOException
    Saves the content of this page to a text file.
    Parameters:
      `file` - file to write this page into
    Throws:
      `IOException` - If an error occurs