Package org.htmlunit

Class 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 with text/
    See Also:
    Serialized Form
    • Constructor Detail

      • 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 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