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 );
291 bool ParseHostInfo(
const std::string hhostInfo );
292 bool ParsePath(
const std::string &path );
293 void ComputeHostId();
295 bool PathEndsWith(
const std::string & sufix )
const;
297 std::string pProtocol;
298 std::string pUserName;
299 std::string pPassword;
300 std::string pHostName;
std::string GetChannelId() const
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.
void SetParams(const ParamsMap ¶ms)
Set params.
const std::string & GetHostName() const
Get the name of the target host.
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)
const std::string & GetProtocol() const
Get the protocol.
void SetParams(const std::string ¶ms)
Set params.
URL()
Default constructor.
std::string GetPathWithFilteredParams() const
Get the path with params, filteres out 'xrdcl.'.
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 & GetUserName() const
Get the username.
void SetPath(const std::string &path)
Set the path.
void SetHostName(const std::string &hostName)
Set the host name.
const std::string & GetPassword() const
Get the password.
const ParamsMap & GetParams() const
Get the URL params.
void SetProtocol(const std::string &protocol)
Set protocol.
std::string GetParamsAsString() const
Get the URL params as string.
bool IsSecure() const
Does the protocol indicate encryption.
const std::string & GetPath() const
Get the path.
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.