com.gargoylesoftware.htmlunit
Class UnexpectedPage

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.UnexpectedPage
All Implemented Interfaces:
Page, Serializable

public class UnexpectedPage
extends Object
implements Page

A generic page that is returned whenever an unexpected content type is returned by the server.

Version:
$Revision: 8370 $
Author:
Mike Bowler, David K. Taylor, Ronald Brill
See Also:
Serialized Form

Constructor Summary
UnexpectedPage(WebResponse webResponse, WebWindow enclosingWindow)
          Creates an instance.
 
Method Summary
 void cleanUp()
          Cleans up this page.
 WebWindow getEnclosingWindow()
          Returns the window that this page is sitting inside.
 InputStream getInputStream()
          Returns an input stream representing all the content that was returned from the server.
 URL getUrl()
          Returns the URL of this page.
 WebResponse getWebResponse()
          Returns the web response that was originally used to create this page.
 void initialize()
          Initialize this page.
 boolean isHtmlPage()
          Returns true if this page is a HtmlPage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnexpectedPage

public UnexpectedPage(WebResponse webResponse,
                      WebWindow enclosingWindow)
Creates an instance.

Parameters:
webResponse - the response from the server that contains the data required to create this page
enclosingWindow - the window that this page is being loaded into
Method Detail

initialize

public void initialize()
Initialize this page.

Specified by:
initialize in interface Page

cleanUp

public void cleanUp()
Cleans up this page.

Specified by:
cleanUp in interface Page

getInputStream

public InputStream getInputStream()
                           throws IOException
Returns an input stream representing all the content that was returned from the server.

Returns:
an input stream representing all the content that was returned from the server
Throws:
IOException - in case of IO problems

getWebResponse

public WebResponse getWebResponse()
Returns the web response that was originally used to create this page.

Specified by:
getWebResponse in interface Page
Returns:
the web response that was originally used to create this page

getEnclosingWindow

public WebWindow getEnclosingWindow()
Returns the window that this page is sitting inside.

Specified by:
getEnclosingWindow in interface Page
Returns:
the enclosing frame or null if this page isn't inside a frame

getUrl

public URL getUrl()
Returns the URL of this page.

Specified by:
getUrl in interface Page
Returns:
the URL of this page

isHtmlPage

public boolean isHtmlPage()
Description copied from interface: Page
Returns true if this page is a HtmlPage.

Specified by:
isHtmlPage in interface Page
Returns:
true or false


Copyright © 2002–2013 Gargoyle Software Inc.. All rights reserved.