Skip to content

Commit 03b3541

Browse files
committed
[net] deprecate TS3WebFile
1 parent e2df120 commit 03b3541

4 files changed

Lines changed: 23 additions & 18 deletions

File tree

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
void P150_TS3WebFile()
22
{
3-
gPluginMgr->AddHandler("TFile", "^[a]?s3:", "TS3WebFile",
4-
"Net", "TS3WebFile(const char*,Option_t*)");
5-
gPluginMgr->AddHandler("TFile", "^s3http[s]?:", "TS3WebFile",
6-
"Net", "TS3WebFile(const char*,Option_t*)");
7-
gPluginMgr->AddHandler("TFile", "^gs:", "TS3WebFile",
8-
"Net", "TS3WebFile(const char*,Option_t*)");
9-
gPluginMgr->AddHandler("TFile", "^gshttp[s]?:", "TS3WebFile",
10-
"Net", "TS3WebFile(const char*,Option_t*)");
3+
gPluginMgr->AddHandler("TFile", "^[a]?s3:", "ROOT::Deprecated::TS3WebFile",
4+
"Net", "ROOT::Deprecated::TS3WebFile(const char*,Option_t*)");
5+
gPluginMgr->AddHandler("TFile", "^s3http[s]?:", "ROOT::Deprecated::TS3WebFile",
6+
"Net", "ROOT::Deprecated::TS3WebFile(const char*,Option_t*)");
7+
gPluginMgr->AddHandler("TFile", "^gs:", "ROOT::Deprecated::TS3WebFile",
8+
"Net", "ROOT::Deprecated::TS3WebFile(const char*,Option_t*)");
9+
gPluginMgr->AddHandler("TFile", "^gshttp[s]?:", "ROOT::Deprecated::TS3WebFile",
10+
"Net", "ROOT::Deprecated::TS3WebFile(const char*,Option_t*)");
1111
}

net/net/inc/LinkDef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656

5757
#ifdef R__SSL
5858
#pragma link C++ class TS3HTTPRequest+;
59-
#pragma link C++ class TS3WebFile+;
59+
#pragma link C++ class ROOT::Deprecated::TS3WebFile+;
6060
#pragma link C++ class TSSLSocket;
6161
#endif
6262

net/net/inc/TS3WebFile.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464

6565
#include "TS3HTTPRequest.h"
6666

67+
namespace ROOT::Deprecated {
6768

6869
class TS3WebFile: public TWebFile {
6970

@@ -105,4 +106,8 @@ class TS3WebFile: public TWebFile {
105106
ClassDefOverride(TS3WebFile, 0) // Read a ROOT file from a S3 server
106107
};
107108

109+
} // namespace ROOT::Deprecated
110+
111+
using TS3WebFile R__DEPRECATED(6, 42, "TS3WebFile is deprecated") = ROOT::Deprecated::TS3WebFile;
112+
108113
#endif // ROOT_TS3WebFile

net/net/src/TS3WebFile.cxx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ As an end user, you must know the Access Key and Secret Access Key
3333
in order to access each S3 file. They are provided to you by your S3
3434
service provider. Those two keys can be provided to ROOT when
3535
initializing an object of this class by two means:
36-
a. by using the environmental variables S3_ACCESS_KEY and
36+
a. by using the environmental variables S3_ACCESS_KEY and
3737
S3_SECRET_KEY, or
3838
b. by specifying them when opening each file.
3939
@@ -148,8 +148,7 @@ For more information on the details of S3 protocol please refer to:
148148
/// is useful when the file is set an access control that allows for
149149
/// any unidentified user to read the file.
150150

151-
TS3WebFile::TS3WebFile(const char* path, Option_t* options)
152-
: TWebFile(path, "IO")
151+
ROOT::Deprecated::TS3WebFile::TS3WebFile(const char* path, Option_t* options) : TWebFile(path, "IO")
153152
{
154153
// Make sure this is a valid S3 path. We accept 'as3' as a scheme, for
155154
// backwards compatibility
@@ -251,7 +250,8 @@ TS3WebFile::TS3WebFile(const char* path, Option_t* options)
251250
/// A security token may be given by the TOKEN option, in order to allow the
252251
/// use of a temporary key pair.
253252

254-
Bool_t TS3WebFile::ParseOptions(Option_t* options, TString& accessKey, TString& secretKey, TString& token)
253+
Bool_t
254+
ROOT::Deprecated::TS3WebFile::ParseOptions(Option_t* options, TString& accessKey, TString& secretKey, TString& token)
255255
{
256256
TString optStr = (const char*)options;
257257
if (optStr.IsNull())
@@ -283,7 +283,7 @@ Bool_t TS3WebFile::ParseOptions(Option_t* options, TString& accessKey, TString&
283283
/// file. Uses TS3HTTPRequest to generate an HTTP HEAD request which includes
284284
/// the authorization header expected by the S3 server.
285285

286-
Int_t TS3WebFile::GetHead()
286+
Int_t ROOT::Deprecated::TS3WebFile::GetHead()
287287
{
288288
fMsgGetHead = fS3Request.GetRequest(TS3HTTPRequest::kHEAD);
289289
return TWebFile::GetHead();
@@ -297,7 +297,7 @@ Int_t TS3WebFile::GetHead()
297297
/// the signature of the request, generated using the user's secret access
298298
/// key.
299299

300-
void TS3WebFile::SetMsgReadBuffer10(const char* redirectLocation, Bool_t tempRedirect)
300+
void ROOT::Deprecated::TS3WebFile::SetMsgReadBuffer10(const char* redirectLocation, Bool_t tempRedirect)
301301
{
302302
TWebFile::SetMsgReadBuffer10(redirectLocation, tempRedirect);
303303
fMsgReadBuffer10 = fS3Request.GetRequest(TS3HTTPRequest::kGET, kFALSE) + "Range: bytes=";
@@ -307,7 +307,7 @@ void TS3WebFile::SetMsgReadBuffer10(const char* redirectLocation, Bool_t tempRed
307307

308308
////////////////////////////////////////////////////////////////////////////////
309309

310-
Bool_t TS3WebFile::ReadBuffers(char* buf, Long64_t* pos, Int_t* len, Int_t nbuf)
310+
Bool_t ROOT::Deprecated::TS3WebFile::ReadBuffers(char* buf, Long64_t* pos, Int_t* len, Int_t nbuf)
311311
{
312312
// Overwrites TWebFile::ReadBuffers() for reading specified byte ranges.
313313
// According to the kind of server this file is hosted by, we use a
@@ -342,7 +342,7 @@ Bool_t TS3WebFile::ReadBuffers(char* buf, Long64_t* pos, Int_t* len, Int_t nbuf)
342342
/// For this class, if the server do not support multirange requests
343343
/// we issue multiple single-range requests instead.
344344

345-
void TS3WebFile::ProcessHttpHeader(const TString& headerLine)
345+
void ROOT::Deprecated::TS3WebFile::ProcessHttpHeader(const TString& headerLine)
346346
{
347347
TPMERegexp rex("^Server: (.+)", "i");
348348
if (rex.Match(headerLine) != 2)
@@ -362,7 +362,7 @@ void TS3WebFile::ProcessHttpHeader(const TString& headerLine)
362362
/// Sets the access and secret keys from the environmental variables, if
363363
/// they are both set. Sets the security session token if it is given.
364364

365-
Bool_t TS3WebFile::GetCredentialsFromEnv(const char* accessKeyEnv, const char* secretKeyEnv,
365+
Bool_t ROOT::Deprecated::TS3WebFile::GetCredentialsFromEnv(const char* accessKeyEnv, const char* secretKeyEnv,
366366
const char* tokenEnv, TString& outAccessKey,
367367
TString& outSecretKey, TString& outToken)
368368
{

0 commit comments

Comments
 (0)