Gui::NetworkRetriever Class Reference

The NetworkRetriever class encapsulates the GNU tool wget. More...

#include <NetworkRetriever.h>

Signals

void wgetExited ()
 

Public Member Functions

void abort ()
 Kills wget if it is still running. More...
 
bool isDownloading () const
 Returns true if wget is still downloading, otherwise returns false. More...
 
 NetworkRetriever (QObject *parent=nullptr)
 
void setEnableConvert (bool)
 If convert is true all non-relative links are converted to relative links. More...
 
void setEnableHTMLExtension (bool)
 Saves all text/html documents with .html extionsion if html is true. More...
 
void setEnableRecursive (bool, int=0)
 If recursive is true all referenced files are downloaded recursively. More...
 
void setEnableTimestamp (bool)
 If ts is true the timestamping is enabled, otherwise timestamping is disabled. More...
 
void setFetchImages (bool)
 If img is true wget tries to get all needed image files to display the HTML page. More...
 
void setFollowRelative (bool)
 If folRel is true wget follows relative links only. More...
 
void setNoParent (bool)
 Do not ever ascend to the parent directory when retrieving recursively. More...
 
void setNumberOfTries (int)
 Sets the number of retries to tries. More...
 
void setOutputDirectory (const QString &)
 Sets the output directory to dir where all downloaded are written into. More...
 
void setOutputFile (const QString &)
 Sets output file to out where documents are written to. More...
 
void setProxy (const QString &, const QString &=QString(), const QString &=QString())
 If you are behind a proxy server then you have to specify your proxy url with proxy. More...
 
bool startDownload (const QString &)
 wget starts to download startUrl and all referenced pages. More...
 
virtual ~NetworkRetriever ()
 

Static Public Member Functions

static bool testWget ()
 This is a test if wget is in PATH environment or not. More...
 

Detailed Description

The NetworkRetriever class encapsulates the GNU tool wget.

wget is a non-interactive network retriever to download e.g. the whole file structure from a server.

Author
Werner Mayer

Constructor & Destructor Documentation

◆ NetworkRetriever()

◆ ~NetworkRetriever()

NetworkRetriever::~NetworkRetriever ( )
virtual

Member Function Documentation

◆ abort()

void NetworkRetriever::abort ( void  )

◆ isDownloading()

bool NetworkRetriever::isDownloading ( ) const

Returns true if wget is still downloading, otherwise returns false.

Referenced by Gui::StdCmdDownloadOnlineHelp::activated().

◆ setEnableConvert()

void NetworkRetriever::setEnableConvert ( bool  convert)

If convert is true all non-relative links are converted to relative links.

As default the convert property is true.

References Gui::NetworkRetrieverP::convert.

Referenced by Gui::StdCmdDownloadOnlineHelp::StdCmdDownloadOnlineHelp().

◆ setEnableHTMLExtension()

void NetworkRetriever::setEnableHTMLExtension ( bool  html)

Saves all text/html documents with .html extionsion if html is true.

As default the html property is false.

References Gui::NetworkRetrieverP::html.

Referenced by Gui::StdCmdDownloadOnlineHelp::StdCmdDownloadOnlineHelp().

◆ setEnableRecursive()

void NetworkRetriever::setEnableRecursive ( bool  recursive,
int  level = 0 
)

If recursive is true all referenced files are downloaded recursively.

As default recursion is disabled. level specifies the maximum recursion depth. If level is 0 the recursion depth is infinite. As default the level property is 1.

Note
: Use this with care!

References Gui::NetworkRetrieverP::level, and Gui::NetworkRetrieverP::recurse.

Referenced by Gui::StdCmdDownloadOnlineHelp::StdCmdDownloadOnlineHelp().

◆ setEnableTimestamp()

void NetworkRetriever::setEnableTimestamp ( bool  ts)

If ts is true the timestamping is enabled, otherwise timestamping is disabled.

If timestamping is enabled files are no more re-retrieved unless they are newer than the local files. As default the timestamping property is disabled.

References Gui::NetworkRetrieverP::timeStamp.

Referenced by Gui::StdCmdDownloadOnlineHelp::StdCmdDownloadOnlineHelp().

◆ setFetchImages()

void NetworkRetriever::setFetchImages ( bool  img)

If img is true wget tries to get all needed image files to display the HTML page.

As default this behaviour is disabled..

References Gui::NetworkRetrieverP::img.

Referenced by Gui::StdCmdDownloadOnlineHelp::StdCmdDownloadOnlineHelp().

◆ setFollowRelative()

void NetworkRetriever::setFollowRelative ( bool  folRel)

If folRel is true wget follows relative links only.

As default the follows relative property is false.

References Gui::NetworkRetrieverP::folRel.

Referenced by Gui::StdCmdDownloadOnlineHelp::StdCmdDownloadOnlineHelp().

◆ setNoParent()

void NetworkRetriever::setNoParent ( bool  nop)

Do not ever ascend to the parent directory when retrieving recursively.

References Gui::NetworkRetrieverP::nop.

Referenced by Gui::StdCmdDownloadOnlineHelp::StdCmdDownloadOnlineHelp().

◆ setNumberOfTries()

void NetworkRetriever::setNumberOfTries ( int  tries)

Sets the number of retries to tries.

If tries is 0 the number of tries is unlimited. The default value of the tries property is set to 3.

References Gui::NetworkRetrieverP::tries.

Referenced by Gui::StdCmdDownloadOnlineHelp::StdCmdDownloadOnlineHelp().

◆ setOutputDirectory()

void NetworkRetriever::setOutputDirectory ( const QString &  dir)

Sets the output directory to dir where all downloaded are written into.

References Gui::NetworkRetrieverP::dir.

Referenced by Gui::StdCmdDownloadOnlineHelp::activated().

◆ setOutputFile()

void NetworkRetriever::setOutputFile ( const QString &  out)

Sets output file to out where documents are written to.

References Gui::NetworkRetrieverP::outputFile.

◆ setProxy()

void NetworkRetriever::setProxy ( const QString &  proxy,
const QString &  user = QString(),
const QString &  passwd = QString() 
)

If you are behind a proxy server then you have to specify your proxy url with proxy.

Moreover, if the proxy requires user authentication then you can specify the username with user and the password with passwd.

References Gui::NetworkRetrieverP::passwd, Gui::NetworkRetrieverP::proxy, and Gui::NetworkRetrieverP::user.

Referenced by Gui::StdCmdDownloadOnlineHelp::activated().

◆ startDownload()

◆ testWget()

bool NetworkRetriever::testWget ( )
static

This is a test if wget is in PATH environment or not.

If the test succeeds true is returned, false otherwise.

Referenced by startDownload().

◆ wgetExited

void Gui::NetworkRetriever::wgetExited ( )
signal

The documentation for this class was generated from the following files: