19#ifndef __XRD_CL_URL_HH__
20#define __XRD_CL_URL_HH__
33 typedef std::map<std::string, std::string>
ParamsMap;
47 URL(
const std::string &url );
55 URL(
const char *url );
123 pProtocol = protocol;
140 pUserName = userName;
158 pPassword = password;
175 pHostName = hostName;
203 pHostName = hostName;
264 void SetParams(
const std::string ¶ms );
286 bool ParseHostInfo(
const std::string hhostInfo );
287 bool ParsePath(
const std::string &path );
288 void ComputeHostId();
290 bool PathEndsWith(
const std::string & sufix )
const;
292 std::string pProtocol;
293 std::string pUserName;
294 std::string pPassword;
295 std::string pHostName;
std::string GetChannelId() const
const std::string & GetPath() const
Get the path.
std::string GetHostId() const
Get the host part of the URL (user:password@host:port)
bool IsMetalink() const
Is it a URL to a metalink.
const std::string & GetPassword() const
Get the password.
void SetParams(const ParamsMap ¶ms)
Set params.
bool FromString(const std::string &url)
Parse a string and fill the URL fields.
void SetPassword(const std::string &password)
Set the password.
void SetHostPort(const std::string &hostName, int port)
void SetParams(const std::string ¶ms)
Set params.
URL()
Default constructor.
std::string GetPathWithFilteredParams() const
Get the path with params, filteres out 'xrdcl.'.
const std::string & GetUserName() const
Get the username.
std::string GetPathWithParams() const
Get the path with params.
std::string GetURL() const
Get the URL.
std::string GetLocation() const
Get location (protocol://host:port/path)
const std::string & GetHostName() const
Get the name of the target host.
void SetPath(const std::string &path)
Set the path.
void SetHostName(const std::string &hostName)
Set the host name.
std::map< std::string, std::string > ParamsMap
void SetProtocol(const std::string &protocol)
Set protocol.
std::string GetParamsAsString() const
Get the URL params as string.
const ParamsMap & GetParams() const
Get the URL params.
bool IsSecure() const
Does the protocol indicate encryption.
const std::string & GetProtocol() const
Get the protocol.
bool IsValid() const
Is the url valid.
void Clear()
Clear the url.
bool IsTPC() const
Is the URL used in TPC context.
int GetPort() const
Get the target port.
void SetUserName(const std::string &userName)
Set the username.
std::string GetLoginToken() const
Get the login token if present in the opaque info.