libzypp 17.31.23
zypp::repo::Downloader Class Reference

Downloader base class. More...

#include <repo/Downloader.h>

Inheritance diagram for zypp::repo::Downloader:

Public Member Functions

 Downloader ()
 Constructor.
 
 Downloader (const RepoInfo &info)
 C-tor associating the downloader with a RepoInfo.
 
virtual ~Downloader ()
 
virtual void download (MediaSetAccess &media, const Pathname &dest_dir, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
 Download metadata to a local directory.
 
virtual RepoStatus status (MediaSetAccess &media)
 Status of the remote repository.
 
const RepoInforepoInfo () const
 
void setPluginRepoverification (std::optional< PluginRepoverification > pluginRepoverification_r)
 
void setNoPluginRepoverification ()
 
- Public Member Functions inherited from zypp::Fetcher
 ZYPP_DECLARE_FLAGS (Options, Option)
 
 Fetcher ()
 Default ctor.
 
virtual ~Fetcher ()
 Dtor.
 
void setOptions (Options options)
 Set the Fetcher options.
 
Options options () const
 Get current options.
 
void addIndex (const OnMediaLocation &resource)
 Adds an index containing metadata (for example checksums ) that will be retrieved and read before the job processing starts.
 
void enqueue (const OnMediaLocation &resource, const FileChecker &checker=FileChecker())
 Enqueue a object for transferal, they will not be transferred until start() is called.
 
void enqueueDigested (const OnMediaLocation &resource, const FileChecker &checker=FileChecker())
 Enqueue a object for transferal, they will not be transferred until start() is called.
 
ZYPP_DEPRECATED void enqueueDigested (const OnMediaLocation &resource, const FileChecker &checker, const Pathname &deltafile)
 
void enqueueDir (const OnMediaLocation &resource, bool recursive=false, const FileChecker &checker=FileChecker())
 Enqueue a directory.
 
void enqueueDigestedDir (const OnMediaLocation &resource, bool recursive=false, const FileChecker &checker=FileChecker())
 Enqueue a directory and always check for checksums.
 
void addCachePath (const Pathname &cache_dir)
 adds a directory to the list of directories where to look for cached files
 
void reset ()
 Reset the transfer (jobs) list.
 
void setMediaSetAccess (MediaSetAccess &media)
 Sets the media set access that will be used to precache and to download the files when start is called.
 
void start (const Pathname &dest_dir, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
 start the transfer to a destination directory dest_dir The media has to be provides with setMediaSetAccess before calling this version of start.
 
void start (const Pathname &dest_dir, MediaSetAccess &media, const ProgressData::ReceiverFnc &progress=ProgressData::ReceiverFnc())
 start the transfer to a destination directory dest_dir You have to provde a media set access media to get the files from The file tree will be replicated inside this directory
 

Protected Member Functions

void defaultDownloadMasterIndex (MediaSetAccess &media_r, const Pathname &destdir_r, const Pathname &masterIndex_r)
 Common workflow downloading a (signed) master index file.
 

Private Attributes

RepoInfo _repoinfo
 
std::optional< PluginRepoverification_pluginRepoverification
 

Additional Inherited Members

- Public Types inherited from zypp::Fetcher
enum  Option { AutoAddContentFileIndexes = 0x0001 , AutoAddChecksumsIndexes = 0x0002 , AutoAddIndexes = AutoAddContentFileIndexes | AutoAddChecksumsIndexes }
 Various option flags to change behavior. More...
 

Detailed Description

Downloader base class.

a Downloader encapsulates all the knowledge of which files have to be downloaded to the local disk.

Definition at line 37 of file Downloader.h.

Constructor & Destructor Documentation

◆ Downloader() [1/2]

zypp::repo::Downloader::Downloader ( )

Constructor.

Definition at line 118 of file Downloader.cc.

◆ Downloader() [2/2]

zypp::repo::Downloader::Downloader ( const RepoInfo info)

C-tor associating the downloader with a RepoInfo.

Definition at line 121 of file Downloader.cc.

◆ ~Downloader()

zypp::repo::Downloader::~Downloader ( )
virtual

Definition at line 124 of file Downloader.cc.

Member Function Documentation

◆ download()

void zypp::repo::Downloader::download ( MediaSetAccess media,
const Pathname dest_dir,
const ProgressData::ReceiverFnc progress = ProgressData::ReceiverFnc() 
)
virtual

Download metadata to a local directory.

Parameters
mediaMedia access to the repository url
dest_dirLocal destination directory
progressprogress receiver

Reimplemented in zypp::repo::susetags::Downloader, and zypp::repo::yum::Downloader.

Definition at line 134 of file Downloader.cc.

◆ status()

RepoStatus zypp::repo::Downloader::status ( MediaSetAccess media)
virtual

Status of the remote repository.

Reimplemented in zypp::repo::susetags::Downloader, and zypp::repo::yum::Downloader.

Definition at line 128 of file Downloader.cc.

◆ repoInfo()

const RepoInfo & zypp::repo::Downloader::repoInfo ( ) const
inline

Definition at line 63 of file Downloader.h.

◆ setPluginRepoverification()

void zypp::repo::Downloader::setPluginRepoverification ( std::optional< PluginRepoverification pluginRepoverification_r)
inline

Definition at line 66 of file Downloader.h.

◆ setNoPluginRepoverification()

void zypp::repo::Downloader::setNoPluginRepoverification ( )
inline

Definition at line 69 of file Downloader.h.

◆ defaultDownloadMasterIndex()

void zypp::repo::Downloader::defaultDownloadMasterIndex ( MediaSetAccess media_r,
const Pathname destdir_r,
const Pathname masterIndex_r 
)
protected

Common workflow downloading a (signed) master index file.

Definition at line 141 of file Downloader.cc.

Member Data Documentation

◆ _repoinfo

RepoInfo zypp::repo::Downloader::_repoinfo
private

Definition at line 77 of file Downloader.h.

◆ _pluginRepoverification

std::optional<PluginRepoverification> zypp::repo::Downloader::_pluginRepoverification
private
See also
Repository metadata verification plugin

Definition at line 78 of file Downloader.h.


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