libzypp 17.36.7

MediaNetworkCommonHandler.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
11#ifndef ZYPP_MEDIA_MEDIANETWORKCOMMONHANDLER_H
12#define ZYPP_MEDIA_MEDIANETWORKCOMMONHANDLER_H
13
14#include <zypp/media/MediaHandler.h>
15#include <zypp-curl/TransferSettings>
16
18 namespace zypp
19{
21 namespace media
22 {
28 // to avoid duplicated code.
30 class MediaNetworkCommonHandler : public MediaHandler
31 {
32 public:
33 MediaNetworkCommonHandler( const Url & url_r,
34 const Pathname & attach_point_r,
35 const Pathname & urlpath_below_attachpoint_r,
36 const bool does_download_r )
37 : MediaHandler( url_r, attach_point_r, urlpath_below_attachpoint_r, does_download_r )
38 , _redirTarget( findGeoIPRedirect(url_r) )
39
40 {}
41
42 public:
43 TransferSettings & settings()
44 { return _settings; }
45
46 protected:
47
52 Url getFileUrl(const Pathname & filename) const;
53
54
59 static zypp::Url findGeoIPRedirect ( const zypp::Url &url );
60
61 public:
62 static const char * anonymousIdHeader();
63
64 static const char * distributionFlavorHeader();
65
66 static const char *agentString();
67
68 protected:
69 mutable TransferSettings _settings;
70 Url _redirTarget;
71 };
72
73 } // namespace media
75} // namespace zypp
77#endif // ZYPP_MEDIA_MEDIANETWORKCOMMONHANDLER_H
MediaHandler.h
zypp::Url
Url manipulation class.
Definition Url.h:93
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
zypp::media::MediaHandler::MediaHandler
MediaHandler(Url url_r, const Pathname &attach_point_r, Pathname urlpath_below_attachpoint_r, const bool does_download_r)
If the concrete media handler provides a nonempty attach_point, it must be an existing directory.
Definition MediaHandler.cc:55
zypp::media::MediaNetworkCommonHandler::getFileUrl
Url getFileUrl(const Pathname &filename) const
concatenate the attach url and the filename to a complete download url
Definition MediaNetworkCommonHandler.cc:105
zypp::media::MediaNetworkCommonHandler::_redirTarget
Url _redirTarget
Definition MediaNetworkCommonHandler.h:70
zypp::media::MediaNetworkCommonHandler::anonymousIdHeader
static const char * anonymousIdHeader()
Definition MediaNetworkCommonHandler.cc:77
zypp::media::MediaNetworkCommonHandler::distributionFlavorHeader
static const char * distributionFlavorHeader()
Definition MediaNetworkCommonHandler.cc:91
zypp::media::MediaNetworkCommonHandler::MediaNetworkCommonHandler
MediaNetworkCommonHandler(const Url &url_r, const Pathname &attach_point_r, const Pathname &urlpath_below_attachpoint_r, const bool does_download_r)
Definition MediaNetworkCommonHandler.h:33
zypp::media::MediaNetworkCommonHandler::findGeoIPRedirect
static zypp::Url findGeoIPRedirect(const zypp::Url &url)
Rewrites the baseURL to the geoIP target if one is found in the metadata cache, otherwise simply retu...
Definition MediaNetworkCommonHandler.cc:26
zypp::media::MediaNetworkCommonHandler::_settings
TransferSettings _settings
Definition MediaNetworkCommonHandler.h:69
zypp::media::MediaNetworkCommonHandler::agentString
static const char * agentString()
Definition MediaNetworkCommonHandler.cc:121
zypp::media::MediaNetworkCommonHandler::settings
TransferSettings & settings()
Definition MediaNetworkCommonHandler.h:43
zypp::media::TransferSettings
Holds transfer setting.
Definition transfersettings.h:34
zypp::media
Definition MediaCD.cc:47
zypp::url
Url details namespace.
Definition UrlBase.cc:58
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20