ensembl-hive  2.7.0
Bio::EnsEMBL::Utils::Net Class Reference

Public Member Functions

public Scalar do_GET ()
 
public Scalar do_FTP ()
 
public Boolean do_FTP_to_file ()
 
protected _retry_sleep ()
 
protected _get_http_tiny ()
 
protected _get_lwp ()
 
protected _get_lwp_to_file ()
 

Detailed Description

Synopsis

#Doing a HTTP get
my $google_contents = do_GET('http://www.google.co.uk/');
#Doing a FTP request; delegates onto LWP
my $ftp_contents = do_GET('https://ftp.ensembl.org/pub/current_README');

Description

A collection of subroutines aimed to helping network based operations. The code
will use HTTP::Tiny for all HTTP operations if available. Otherwise it
will delegate to LWP. LWP is currently the only supported target for FTP.

Definition at line 25 of file Net.pm.

Member Function Documentation

◆ _get_http_tiny()

protected Bio::EnsEMBL::Utils::Net::_get_http_tiny ( )

Undocumented method

Code:
click to view

◆ _get_lwp()

protected Bio::EnsEMBL::Utils::Net::_get_lwp ( )

Undocumented method

Code:
click to view

◆ _get_lwp_to_file()

protected Bio::EnsEMBL::Utils::Net::_get_lwp_to_file ( )

Undocumented method

Code:
click to view

◆ _retry_sleep()

protected Bio::EnsEMBL::Utils::Net::_retry_sleep ( )

Undocumented method

Code:
click to view

◆ do_FTP()

public Scalar Bio::EnsEMBL::Utils::Net::do_FTP ( )
  Arg [1]     : string $uri
  Arg [2]     : int; $total_attempts The number of times to try the URI 
                before throwing an exception
  Arg [3]     : number; $sleep Amount of time to sleep between attempts. 
                Delegates onto Time::HiRes so floating point numbers are 
                supported
  Description : Performs a FTP fetch using a non-authenticated connection (
                however some servers will allow you to encode this in the URI).
  Returntype  : Scalar of the contents of the remote URL. Do not use to
                retrieve very large amounts of data.
  Example     :
my $contents = do_GET('http://www.google.co.uk/');
  Exceptions  : If we could not retrieve the resource after the specified 
                number of attempts.
  Status      : Stable
 
Code:
click to view

◆ do_FTP_to_file()

public Boolean Bio::EnsEMBL::Utils::Net::do_FTP_to_file ( )
  Arg [1]     : string $uri
  Arg [2]     : int; $total_attempts The number of times to try the URI 
                before throwing an exception
  Arg [3]     : number; $sleep Amount of time to sleep between attempts. 
                Delegates onto Time::HiRes so floating point numbers are 
                supported
  Description : Performs a FTP fetch using a non-authenticated connection (
                however some servers will allow you to encode this in the URI).
  Returntype  : Boolean true if download was successful.
  Example     :
my $contents = do_GET('http://www.google.co.uk/');
  Exceptions  : If we could not retrieve the resource after the specified 
                number of attempts.
  Status      : Stable
 
Code:
click to view

◆ do_GET()

public Scalar Bio::EnsEMBL::Utils::Net::do_GET ( )
  Arg [1]     : string $url The URL to fetch including all parameters
  Arg [2]     : int; $total_attempts The number of times to try the URL 
                before throwing an exception
  Arg [3]     : number; $sleep Amount of time to sleep between attempts. 
                Delegates onto Time::HiRes so floating point numbers are 
                supported
  Description : Performs a HTTP GET method call to return the specified remote
                resource.
  Returntype  : Scalar of the contents of the remote URL. Do not use to
                retrieve very large amounts of data.
  Example     :
my $contents = do_GET('http://www.google.co.uk/');
  Exceptions  : If we could not retrieve the resource after the specified 
                number of attempts.
  Status      : Stable
 
Code:
click to view

The documentation for this class was generated from the following file:
Bio::EnsEMBL::Utils::Net
Definition: Net.pm:25
Bio::EnsEMBL::Utils::Net::do_GET
public Scalar do_GET()
Bio::EnsEMBL::Utils::Net::_get_lwp_to_file
protected _get_lwp_to_file()
Bio::EnsEMBL::Utils::Net::_get_http_tiny
protected _get_http_tiny()
Bio::EnsEMBL::Utils::Net::_get_lwp
protected _get_lwp()
Bio::EnsEMBL::Utils::Net::do_FTP
public Scalar do_FTP()
Bio::EnsEMBL::Utils::Net::do_FTP_to_file
public Boolean do_FTP_to_file()
Bio::EnsEMBL::Utils::Net::_retry_sleep
protected _retry_sleep()