class CAVERNplus_http_c

A class to load files from WEB servers

Public Fields

const int NO_TIME_OUT
Turn timeout off when loading from WEB page.

Public Methods

int grabWEBFile ()
Grab the WEB file
void setTimeOut (int timep)
Set the timeout period during WEB page loading.

Public


Accessor functions.
void setRemoteSite (char *site)
Set the IP address of remote site.
void setRemotePath (char *path)
Set the path from the remote site.
void setRemoteFile (char *file)
Set the remote file to download.
void setLocalPath (char *path)
Set the local path to store downloaded file.
void setLocalFile (char *file)
Set the local file to store downloaded file.
void setMode (int mode)
Set download mode
int getTimeOut ()
Get timeout period.
char* getRemoteSite ()
Counterpart of SetRemoteSite.
char* getRemotePath ()
Counterpart of SetRemotePath.
char* getRemoteFile ()
Counterpart of SetRemoteFile.
char* getLocalPath ()
Counterpart of SetLocalPath.
char* getLocalFile ()
Counterpart of GetLocalFile.
int getMode ()
Counterpart of SetMode.

SetMode flags.
const int AUTO_LOAD
Autoload from WEB page checking local cached file.
const int CHECK_BUT_DONT_LOAD
Check the status of WEB page.
const int FORCED_LOAD
Force a load from the WEB page ignoring the cache.

Documentation

A class to load files from WEB servers.

This is a class to grab a file off a WEB site depending on whether the local cached version is older than the remote one.

Begin by creating a webget object. Using the accessor functions, assign to it the remote WEB address, path and file. Then assign the local path and file.

Call SetMode to choose the operation you wish.

Finally call GrabWEBFile and check the return status.

void setMode(int mode)
Set download mode
Parameters:
mode - Set to either AUTO LOAD, FORCED LOAD or CHECK BUT DONT LOAD.
See Also:
SetMode Flags.

int grabWEBFile()
Grab the WEB file. Mode of grab is determined by SetMode method.
Returns:
200 if modified and downloaded ok. -1 if timed out but cache file exists. -11 if timed out but cache file DOES NOT exist. -2 if cannot connect. -3 if get of file successful but rename of tmpfile failed. -4 if unable to write to local file. -5 if modified : only for CHECK_BUT_DONT_LOAD mode. -6 if unable to get the content length of the remote file. else returns WEB status numbers. e.g. 304 is file not modified. 404 is file not found.


This class has no child classes.
Author:
(C) 1997 Jason Leigh.
Version:
4/1/97.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de