Groovy Documentation

geb.download
[Groovy] Class DownloadSupport

java.lang.Object
  geb.download.DownloadSupport

class DownloadSupport

Provides methods to directly download content into the running program using HttpURLConnection.

Any cookies that the browser currently has will be automatically transferred to the url connection, allowing it to assume the context of the browser.

An instance of this class will be mixed in to all browser, page and module objects making these methods public methods on those objects.


Constructor Summary
DownloadSupport(Browser browser)

 
Method Summary
HttpURLConnection download(Map options = [:])

Creates a http url connection to a url, that has the same cookies as the browser.

HttpURLConnection download(String uri)

Calls download with the single option 'uri' as the given value.

byte[] downloadBytes(Map options = [:], Closure connectionConfig = null)

Opens a url connection via download(Map) and returns the raw bytes.

byte[] downloadBytes(Closure connectionConfig)

Opens a url connection via download() and returns the raw bytes.

byte[] downloadBytes(String uri, Closure connectionConfig = null)

Opens a url connection via download(String) and returns the raw bytes.

Object downloadContent(Map options = [:], Closure connectionConfig = null)

Opens a url connection via download(Map) and returns the content object.

Object downloadContent(String uri, Closure connectionConfig = null)

Opens a url connection via download(String) and returns the content object.

Object downloadContent(Closure connectionConfig)

Opens a url connection via download(String) and returns the content object.

InputStream downloadStream(Map options = [:], Closure connectionConfig = null)

Opens a url connection via download(Map) and returns the response input stream.

InputStream downloadStream(String uri, Closure connectionConfig = null)

Opens a url connection via download(String) and returns the response input stream.

InputStream downloadStream(Closure connectionConfig)

Opens a url connection via download() and returns the response input stream.

String downloadText(Map options = [:], Closure connectionConfig = null)

Opens a url connection via download(Map) and returns the response text, if the content type was textual.

String downloadText(String uri, Closure connectionConfig = null)

Opens a url connection via download(String) and returns the response text, if the content type was textual.

String downloadText(Closure connectionConfig)

Opens a url connection via download() and returns the response text, if the content type was textual.

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Constructor Detail

DownloadSupport

DownloadSupport(Browser browser)


 
Method Detail

download

HttpURLConnection download(Map options = [:])
Creates a http url connection to a url, that has the same cookies as the browser.

Valid options are:


download

HttpURLConnection download(String uri)
Calls download with the single option 'uri' as the given value.


downloadBytes

byte[] downloadBytes(Map options = [:], Closure connectionConfig = null)
Opens a url connection via download(Map) and returns the raw bytes.

If connectionConfig is given, it is called with the HttpURLConnection before the request is made.


downloadBytes

byte[] downloadBytes(Closure connectionConfig)
Opens a url connection via download() and returns the raw bytes.

connectionConfig is called with the HttpURLConnection before the request is made.


downloadBytes

byte[] downloadBytes(String uri, Closure connectionConfig = null)
Opens a url connection via download(String) and returns the raw bytes.

If connectionConfig is given, it is called with the HttpURLConnection before the request is made.


downloadContent

Object downloadContent(Map options = [:], Closure connectionConfig = null)
Opens a url connection via download(Map) and returns the content object.

If connectionConfig is given, it is called with the HttpURLConnection before the request is made.

See Also:
URLConnection.getContent


downloadContent

Object downloadContent(String uri, Closure connectionConfig = null)
Opens a url connection via download(String) and returns the content object.

If connectionConfig is given, it is called with the HttpURLConnection before the request is made.

See Also:
URLConnection.getContent


downloadContent

Object downloadContent(Closure connectionConfig)
Opens a url connection via download(String) and returns the content object.

connectionConfig is called with the HttpURLConnection before the request is made.

See Also:
URLConnection.getContent


downloadStream

InputStream downloadStream(Map options = [:], Closure connectionConfig = null)
Opens a url connection via download(Map) and returns the response input stream.

If connectionConfig is given, it is called with the HttpURLConnection before the request is made.


downloadStream

InputStream downloadStream(String uri, Closure connectionConfig = null)
Opens a url connection via download(String) and returns the response input stream.

If connectionConfig is given, it is called with the HttpURLConnection before the request is made.


downloadStream

InputStream downloadStream(Closure connectionConfig)
Opens a url connection via download() and returns the response input stream.

connectionConfig is called with the HttpURLConnection before the request is made.


downloadText

String downloadText(Map options = [:], Closure connectionConfig = null)
Opens a url connection via download(Map) and returns the response text, if the content type was textual.

If connectionConfig is given, it is called with the HttpURLConnection before the request is made.


downloadText

String downloadText(String uri, Closure connectionConfig = null)
Opens a url connection via download(String) and returns the response text, if the content type was textual.

If connectionConfig is given, it is called with the HttpURLConnection before the request is made.


downloadText

String downloadText(Closure connectionConfig)
Opens a url connection via download() and returns the response text, if the content type was textual.

connectionConfig is called with the HttpURLConnection before the request is made.


 

Groovy API Documentation for Geb 0.9.1 - Licensed under the Apache License, Version 2.0 - http://www.gebish.org