libzypp 17.31.23
zyppng::DownloadSpec Class Reference

#include </home/abuild/rpmbuild/BUILD/libzypp-17.31.23/zypp-curl/ng/network/downloadspec.h>

Public Member Functions

 DownloadSpec (Url file, zypp::filesystem::Pathname targetPath, zypp::ByteCount expectedFileSize=zypp::ByteCount())
 
 DownloadSpec (const DownloadSpec &other)
 
DownloadSpecoperator= (const DownloadSpec &other)
 
const Url & url () const
 
DownloadSpecsetUrl (const Url &url)
 
const zypp::PathnametargetPath () const
 
DownloadSpecsetTargetPath (const zypp::Pathname &path)
 
DownloadSpecsetMetalinkEnabled (bool enable=true)
 
bool metalinkEnabled () const
 
DownloadSpecsetCheckExistsOnly (bool set=true)
 
bool checkExistsOnly () const
 
DownloadSpecsetDeltaFile (const zypp::Pathname &file)
 
zypp::filesystem::Pathname deltaFile () const
 
DownloadSpecsetPreferredChunkSize (const zypp::ByteCount &bc)
 
zypp::ByteCount preferredChunkSize () const
 
const TransferSettingssettings () const
 
DownloadSpecsetTransferSettings (TransferSettings &&set)
 
DownloadSpecsetTransferSettings (const TransferSettings &set)
 
DownloadSpecsetExpectedFileSize (const zypp::ByteCount &bc)
 
zypp::ByteCount expectedFileSize () const
 
DownloadSpecsetHeaderSize (const zypp::ByteCount &bc)
 
zypp::ByteCount headerSize () const
 
const std::optional< zypp::CheckSum > & headerChecksum () const
 
DownloadSpecsetHeaderChecksum (const zypp::CheckSum &sum)
 

Private Attributes

zypp::RWCOW_pointer< DownloadSpecPrivated_ptr
 

Detailed Description

Specifies all aspects of a download. Used together with the zyppng::Download and zyppng::Downloader classes

Definition at line 37 of file downloadspec.h.

Constructor & Destructor Documentation

◆ DownloadSpec() [1/2]

zyppng::DownloadSpec::DownloadSpec ( Url  file,
zypp::filesystem::Pathname  targetPath,
zypp::ByteCount  expectedFileSize = zypp::ByteCount() 
)

Definition at line 38 of file downloadspec.cc.

◆ DownloadSpec() [2/2]

zyppng::DownloadSpec::DownloadSpec ( const DownloadSpec other)
default

Member Function Documentation

◆ operator=()

DownloadSpec & zyppng::DownloadSpec::operator= ( const DownloadSpec other)
default

◆ url()

const Url & zyppng::DownloadSpec::url ( ) const

Returns the source URL of the download

Definition at line 50 of file downloadspec.cc.

◆ setUrl()

DownloadSpec & zyppng::DownloadSpec::setUrl ( const Url &  url)

Definition at line 55 of file downloadspec.cc.

◆ targetPath()

const zypp::Pathname & zyppng::DownloadSpec::targetPath ( ) const

Returns the target file path, this is where the downloaded data is stored

Definition at line 61 of file downloadspec.cc.

◆ setTargetPath()

DownloadSpec & zyppng::DownloadSpec::setTargetPath ( const zypp::Pathname path)

Definition at line 66 of file downloadspec.cc.

◆ setMetalinkEnabled()

DownloadSpec & zyppng::DownloadSpec::setMetalinkEnabled ( bool  enable = true)

Enabled or disabled metalink handling. Enabled by default.

Note
if Metalink is enabled the Download tells the server that it accepts metalink files by adding a specific header to the request.

Definition at line 72 of file downloadspec.cc.

◆ metalinkEnabled()

bool zyppng::DownloadSpec::metalinkEnabled ( ) const

Definition at line 78 of file downloadspec.cc.

◆ setCheckExistsOnly()

DownloadSpec & zyppng::DownloadSpec::setCheckExistsOnly ( bool  set = true)

Enables a special mode, in this case only the existance of the file is checked but no data is actually downloaded

Definition at line 83 of file downloadspec.cc.

◆ checkExistsOnly()

bool zyppng::DownloadSpec::checkExistsOnly ( ) const

Definition at line 89 of file downloadspec.cc.

◆ setDeltaFile()

DownloadSpec & zyppng::DownloadSpec::setDeltaFile ( const zypp::Pathname file)

Set a already existing local file to be used for partial downloading, in case of a multichunk download all chunks from the file that have the expected checksum will be reused instead of downloaded

Definition at line 94 of file downloadspec.cc.

◆ deltaFile()

zypp::Pathname zyppng::DownloadSpec::deltaFile ( ) const

Definition at line 100 of file downloadspec.cc.

◆ setPreferredChunkSize()

DownloadSpec & zyppng::DownloadSpec::setPreferredChunkSize ( const zypp::ByteCount bc)

Sets the prefered amount of bytes the downloader tries to request from a single server per metalink chunk request. If the metalink description has smaller chunks those are coalesced to match the preferred size.

Setting this to 0 tells the Downloader instance to automatically calculate the chunk size. This is also the default.

Definition at line 105 of file downloadspec.cc.

◆ preferredChunkSize()

zypp::ByteCount zyppng::DownloadSpec::preferredChunkSize ( ) const

Definition at line 111 of file downloadspec.cc.

◆ settings()

const TransferSettings & zyppng::DownloadSpec::settings ( ) const

Returns the

See also
zyppng::TransferSettings for the download. The settings are reused for possible sub downloads, however authentication data is stripped if the subdownload uses a different host to fetch the data from. If there is no auth data known
sigAuthRequired is emitted.

Definition at line 116 of file downloadspec.cc.

◆ setTransferSettings() [1/2]

DownloadSpec & zyppng::DownloadSpec::setTransferSettings ( TransferSettings &&  set)

Definition at line 121 of file downloadspec.cc.

◆ setTransferSettings() [2/2]

DownloadSpec & zyppng::DownloadSpec::setTransferSettings ( const TransferSettings set)

Definition at line 127 of file downloadspec.cc.

◆ setExpectedFileSize()

DownloadSpec & zyppng::DownloadSpec::setExpectedFileSize ( const zypp::ByteCount bc)

Definition at line 133 of file downloadspec.cc.

◆ expectedFileSize()

zypp::ByteCount zyppng::DownloadSpec::expectedFileSize ( ) const

Definition at line 139 of file downloadspec.cc.

◆ setHeaderSize()

DownloadSpec & zyppng::DownloadSpec::setHeaderSize ( const zypp::ByteCount bc)

Definition at line 144 of file downloadspec.cc.

◆ headerSize()

zypp::ByteCount zyppng::DownloadSpec::headerSize ( ) const

Definition at line 150 of file downloadspec.cc.

◆ headerChecksum()

const std::optional< zypp::CheckSum > & zyppng::DownloadSpec::headerChecksum ( ) const

Definition at line 155 of file downloadspec.cc.

◆ setHeaderChecksum()

DownloadSpec & zyppng::DownloadSpec::setHeaderChecksum ( const zypp::CheckSum sum)

Definition at line 161 of file downloadspec.cc.

Member Data Documentation

◆ d_ptr

zypp::RWCOW_pointer<DownloadSpecPrivate> zyppng::DownloadSpec::d_ptr
private

Definition at line 109 of file downloadspec.h.


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