com.gargoylesoftware.htmlunit
Class BinaryPage

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

public class BinaryPage
extends Object
implements Page

A page for binary content. You must use getInputStream() to get the content.

Version:
$Revision: 5805 $
Author:
Ahmed Ashour
See Also:
Serialized Form

Constructor Summary
BinaryPage(WebResponse webResponse, WebWindow enclosingWindow)
          Creates an instance.
 
Method Summary
 void cleanUp()
          Clean 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryPage

public BinaryPage(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. This method gets called when a new page is loaded and you should probably never need to call it directly.

Specified by:
initialize in interface Page

cleanUp

public void cleanUp()
Clean up this page. This method gets called by the web client when an other page is loaded in the window and you should probably never need to call it directly

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 - if an IO error occurs

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

getEnclosingWindow

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

Specified by:
getEnclosingWindow in interface Page
Returns:
the enclosing window

getUrl

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

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


Copyright © 2002-2010 Gargoyle Software Inc.. All Rights Reserved.