Gui::NetworkRetriever Class Reference

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

#include <NetworkRetriever.h>

List of all members.

Signals

void wgetExited ()

Public Member Functions

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

Static Public Member Functions

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

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

Definition at line 40 of file NetworkRetriever.h.


Constructor & Destructor Documentation

NetworkRetriever::NetworkRetriever ( QObject *  parent = 0  ) 
NetworkRetriever::~NetworkRetriever (  )  [virtual]

Definition at line 101 of file NetworkRetriever.cpp.


Member Function Documentation

void NetworkRetriever::abort ( void   ) 

Kills wget if it is still running.

Definition at line 349 of file NetworkRetriever.cpp.

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

bool NetworkRetriever::isDownloading (  )  const

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

Definition at line 341 of file NetworkRetriever.cpp.

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

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.

Definition at line 190 of file NetworkRetriever.cpp.

References Gui::NetworkRetrieverP::convert.

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

void NetworkRetriever::setEnableHTMLExtension ( bool  html  ) 

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

As default the html property is false.

Definition at line 208 of file NetworkRetriever.cpp.

References Gui::NetworkRetrieverP::html.

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

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

If recursive is true all referenced files are downloaded recursivly.

As default recursivion 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!

Definition at line 171 of file NetworkRetriever.cpp.

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

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

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.

Definition at line 147 of file NetworkRetriever.cpp.

References Gui::NetworkRetrieverP::timeStamp.

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

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..

Definition at line 199 of file NetworkRetriever.cpp.

References Gui::NetworkRetrieverP::img.

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

void NetworkRetriever::setFollowRelative ( bool  folRel  ) 

If folRel is true wget follows relative links only.

As default the follows relative property is false.

Definition at line 181 of file NetworkRetriever.cpp.

References Gui::NetworkRetrieverP::folRel.

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

void NetworkRetriever::setNoParent ( bool  nop  ) 

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

Definition at line 216 of file NetworkRetriever.cpp.

References Gui::NetworkRetrieverP::nop.

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

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.

Definition at line 129 of file NetworkRetriever.cpp.

References Gui::NetworkRetrieverP::tries.

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

void NetworkRetriever::setOutputDirectory ( const QString &  dir  ) 

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

Definition at line 224 of file NetworkRetriever.cpp.

References Gui::NetworkRetrieverP::dir.

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

void NetworkRetriever::setOutputFile ( const QString &  out  ) 

Sets output file to out where documents are written to.

Definition at line 137 of file NetworkRetriever.cpp.

References Gui::NetworkRetrieverP::outputFile.

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

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

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

Definition at line 157 of file NetworkRetriever.cpp.

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

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

bool NetworkRetriever::startDownload ( const QString &  startUrl  ) 
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.

Definition at line 371 of file NetworkRetriever.cpp.

Referenced by startDownload().

void Gui::NetworkRetriever::wgetExited (  )  [signal]

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

Generated on Wed Nov 23 19:02:00 2011 for FreeCAD by  doxygen 1.6.1