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 );
128 pProtocol = protocol;
145 pUserName = userName;
163 pPassword = password;
180 pHostName = hostName;
208 pHostName = hostName;
269 void SetParams(
const std::string ¶ms );
283 void SetParam(
const std::string &name,
const std::string &value )
285 pParams[name] = value;
300 bool ParseHostInfo(
const std::string hhostInfo );
301 bool ParsePath(
const std::string &path );
302 void ComputeHostId();
304 bool PathEndsWith(
const std::string & sufix )
const;
306 std::string pProtocol;
307 std::string pUserName;
308 std::string pPassword;
309 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.
std::map< std::string, std::string > ParamsMap
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 GetObfuscatedURL() const
Get the URL with authz information obfuscated.
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.
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.
void SetParam(const std::string &name, const std::string &value)
Set a single param.
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.