Skip to content

Commit 0fef1ab

Browse files
committed
[net] deprecate TFTP
1 parent 0fb6b48 commit 0fef1ab

File tree

3 files changed

+29
-24
lines changed

3 files changed

+29
-24
lines changed

net/net/inc/LinkDef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#pragma link C++ class ROOT::Deprecated::TNetSystem;
2929
#pragma link C++ class TWebFile;
3030
#pragma link C++ class TWebSystem;
31-
#pragma link C++ class TFTP;
31+
#pragma link C++ class ROOT::Deprecated::TFTP;
3232
#pragma link C++ class TSQLServer;
3333
#pragma link C++ class TSQLResult;
3434
#pragma link C++ class TSQLRow;

net/net/inc/TFTP.h

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

3131
class TSocket;
3232

33+
namespace ROOT::Deprecated {
3334

3435
class TFTP : public TObject {
3536

@@ -125,4 +126,8 @@ class TFTP : public TObject {
125126
ClassDefOverride(TFTP, 1) // File Transfer Protocol class using rootd
126127
};
127128

129+
} // namespace ROOT::Deprecated
130+
131+
using TFTP R__DEPRECATED(6, 42, "TFTP is deprecated") = ROOT::Deprecated::TFTP;
132+
128133
#endif

net/net/src/TFTP.cxx

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Long64_t TFTP::fgBytesRead = 0;
7070
/// An existing connection (TSocket *sock) can also be used to establish
7171
/// the FTP session.
7272

73-
TFTP::TFTP(const char *url, Int_t par, Int_t wsize, TSocket *sock)
73+
ROOT::Deprecated::TFTP::TFTP(const char *url, Int_t par, Int_t wsize, TSocket *sock)
7474
{
7575
fSocket = sock;
7676

@@ -91,7 +91,7 @@ TFTP::TFTP(const char *url, Int_t par, Int_t wsize, TSocket *sock)
9191
////////////////////////////////////////////////////////////////////////////////
9292
/// Set up the actual connection.
9393

94-
void TFTP::Init(const char *surl, Int_t par, Int_t wsize)
94+
void ROOT::Deprecated::TFTP::Init(const char *surl, Int_t par, Int_t wsize)
9595
{
9696
TUrl url(surl);
9797
TString hurl(url.GetProtocol());
@@ -145,15 +145,15 @@ void TFTP::Init(const char *surl, Int_t par, Int_t wsize)
145145
////////////////////////////////////////////////////////////////////////////////
146146
/// TFTP dtor. Send close message and close socket.
147147

148-
TFTP::~TFTP()
148+
ROOT::Deprecated::TFTP::~TFTP()
149149
{
150150
Close();
151151
}
152152

153153
////////////////////////////////////////////////////////////////////////////////
154154
/// Print some info about the FTP connection.
155155

156-
void TFTP::Print(Option_t *) const
156+
void ROOT::Deprecated::TFTP::Print(Option_t *) const
157157
{
158158
TString secCont;
159159

@@ -179,7 +179,7 @@ void TFTP::Print(Option_t *) const
179179
////////////////////////////////////////////////////////////////////////////////
180180
/// Print error string depending on error code.
181181

182-
void TFTP::PrintError(const char *where, Int_t err) const
182+
void ROOT::Deprecated::TFTP::PrintError(const char *where, Int_t err) const
183183
{
184184
Error(where, "%s", gRootdErrStr[err]);
185185
}
@@ -188,7 +188,7 @@ void TFTP::PrintError(const char *where, Int_t err) const
188188
/// Return status from rootd server and message kind. Returns -1 in
189189
/// case of error otherwise 8 (sizeof 2 words, status and kind).
190190

191-
Int_t TFTP::Recv(Int_t &status, EMessageTypes &kind) const
191+
Int_t ROOT::Deprecated::TFTP::Recv(Int_t &status, EMessageTypes &kind) const
192192
{
193193
kind = kROOTD_ERR;
194194
status = 0;
@@ -204,7 +204,7 @@ Int_t TFTP::Recv(Int_t &status, EMessageTypes &kind) const
204204
////////////////////////////////////////////////////////////////////////////////
205205
/// Make sure the block size is a power of two, with a minimum of 32768.
206206

207-
void TFTP::SetBlockSize(Int_t blockSize)
207+
void ROOT::Deprecated::TFTP::SetBlockSize(Int_t blockSize)
208208
{
209209
if (blockSize < 32768) {
210210
fBlockSize = 32768;
@@ -230,7 +230,7 @@ void TFTP::SetBlockSize(Int_t blockSize)
230230
/// the case (e.g. due to a crash), you can force unlock it by prepending
231231
/// the remoteName with a '-'.
232232

233-
Long64_t TFTP::PutFile(const char *file, const char *remoteName)
233+
Long64_t ROOT::Deprecated::TFTP::PutFile(const char *file, const char *remoteName)
234234
{
235235
if (!IsOpen() || !file || !*file) return -1;
236236

@@ -403,7 +403,7 @@ Long64_t TFTP::PutFile(const char *file, const char *remoteName)
403403
/// the case (e.g. due to a crash), you can force unlock it by prepending
404404
/// the file name with a '-'.
405405

406-
Long64_t TFTP::GetFile(const char *file, const char *localName)
406+
Long64_t ROOT::Deprecated::TFTP::GetFile(const char *file, const char *localName)
407407
{
408408
if (!IsOpen() || !file || !*file) return -1;
409409

@@ -625,7 +625,7 @@ Long64_t TFTP::GetFile(const char *file, const char *localName)
625625
/// file and it is < 1024 characters then the contents is echoed back.
626626
/// Returns 0 in case of success and -1 in case of failure.
627627

628-
Int_t TFTP::ChangeDirectory(const char *dir) const
628+
Int_t ROOT::Deprecated::TFTP::ChangeDirectory(const char *dir) const
629629
{
630630
if (!IsOpen()) return -1;
631631

@@ -664,7 +664,7 @@ Int_t TFTP::ChangeDirectory(const char *dir) const
664664
/// Make a remote directory. Anonymous users may not create directories.
665665
/// Returns 0 in case of success and -1 in case of failure.
666666

667-
Int_t TFTP::MakeDirectory(const char *dir, Bool_t print) const
667+
Int_t ROOT::Deprecated::TFTP::MakeDirectory(const char *dir, Bool_t print) const
668668
{
669669
if (!IsOpen()) return -1;
670670

@@ -699,7 +699,7 @@ Int_t TFTP::MakeDirectory(const char *dir, Bool_t print) const
699699
/// Delete a remote directory. Anonymous users may not delete directories.
700700
/// Returns 0 in case of success and -1 in case of failure.
701701

702-
Int_t TFTP::DeleteDirectory(const char *dir) const
702+
Int_t ROOT::Deprecated::TFTP::DeleteDirectory(const char *dir) const
703703
{
704704
if (!IsOpen()) return -1;
705705

@@ -731,7 +731,7 @@ Int_t TFTP::DeleteDirectory(const char *dir) const
731731
/// to be listed to ls. Returns 0 in case of success and -1 in case of
732732
/// failure.
733733

734-
Int_t TFTP::ListDirectory(Option_t *cmd) const
734+
Int_t ROOT::Deprecated::TFTP::ListDirectory(Option_t *cmd) const
735735
{
736736
if (!IsOpen()) return -1;
737737

@@ -761,7 +761,7 @@ Int_t TFTP::ListDirectory(Option_t *cmd) const
761761
/// Print path of remote working directory. Returns 0 in case of succes and
762762
/// -1 in cse of failure.
763763

764-
Int_t TFTP::PrintDirectory() const
764+
Int_t ROOT::Deprecated::TFTP::PrintDirectory() const
765765
{
766766
if (!IsOpen()) return -1;
767767

@@ -787,7 +787,7 @@ Int_t TFTP::PrintDirectory() const
787787
/// Rename a remote file. Anonymous users may not rename files.
788788
/// Returns 0 in case of success and -1 in case of failure.
789789

790-
Int_t TFTP::RenameFile(const char *file1, const char *file2) const
790+
Int_t ROOT::Deprecated::TFTP::RenameFile(const char *file1, const char *file2) const
791791
{
792792
if (!IsOpen()) return -1;
793793

@@ -818,7 +818,7 @@ Int_t TFTP::RenameFile(const char *file1, const char *file2) const
818818
/// Delete a remote file. Anonymous users may not delete files.
819819
/// Returns 0 in case of success and -1 in case of failure.
820820

821-
Int_t TFTP::DeleteFile(const char *file) const
821+
Int_t ROOT::Deprecated::TFTP::DeleteFile(const char *file) const
822822
{
823823
if (!IsOpen()) return -1;
824824

@@ -850,7 +850,7 @@ Int_t TFTP::DeleteFile(const char *file) const
850850
/// chnage permissions. Returns 0 in case of success and -1 in case
851851
/// of failure.
852852

853-
Int_t TFTP::ChangePermission(const char *file, Int_t mode) const
853+
Int_t ROOT::Deprecated::TFTP::ChangePermission(const char *file, Int_t mode) const
854854
{
855855
if (!IsOpen()) return -1;
856856

@@ -881,7 +881,7 @@ Int_t TFTP::ChangePermission(const char *file, Int_t mode) const
881881
/// Close ftp connection. Returns 0 in case of success and -1 in case of
882882
/// failure.
883883

884-
Int_t TFTP::Close()
884+
Int_t ROOT::Deprecated::TFTP::Close()
885885
{
886886
if (!IsOpen()) return -1;
887887

@@ -911,7 +911,7 @@ Int_t TFTP::Close()
911911
/// Returns kTRUE in case of success.
912912
/// Returns kFALSE in case of error.
913913

914-
Bool_t TFTP::OpenDirectory(const char *dir, Bool_t print)
914+
Bool_t ROOT::Deprecated::TFTP::OpenDirectory(const char *dir, Bool_t print)
915915
{
916916
fDir = kFALSE;
917917

@@ -953,7 +953,7 @@ Bool_t TFTP::OpenDirectory(const char *dir, Bool_t print)
953953
////////////////////////////////////////////////////////////////////////////////
954954
/// Free a remotely open directory via rootd.
955955

956-
void TFTP::FreeDirectory(Bool_t print)
956+
void ROOT::Deprecated::TFTP::FreeDirectory(Bool_t print)
957957
{
958958
if (!IsOpen() || !fDir) return;
959959

@@ -985,7 +985,7 @@ void TFTP::FreeDirectory(Bool_t print)
985985
/// Get directory entry via rootd.
986986
/// Returns 0 in case no more entries or in case of error.
987987

988-
const char *TFTP::GetDirEntry(Bool_t print)
988+
const char *ROOT::Deprecated::TFTP::GetDirEntry(Bool_t print)
989989
{
990990
static char dirent[1024] = {0};
991991

@@ -1026,7 +1026,7 @@ const char *TFTP::GetDirEntry(Bool_t print)
10261026
/// The function returns 0 in case of success and 1 if the file could
10271027
/// not be stat'ed.
10281028

1029-
Int_t TFTP::GetPathInfo(const char *path, FileStat_t &buf, Bool_t print)
1029+
Int_t ROOT::Deprecated::TFTP::GetPathInfo(const char *path, FileStat_t &buf, Bool_t print)
10301030
{
10311031
TUrl url(path);
10321032

@@ -1108,7 +1108,7 @@ Int_t TFTP::GetPathInfo(const char *path, FileStat_t &buf, Bool_t print)
11081108
/// Mode is the same as for the Unix access(2) function.
11091109
/// Attention, bizarre convention of return value!!
11101110

1111-
Bool_t TFTP::AccessPathName(const char *path, EAccessMode mode, Bool_t print)
1111+
Bool_t ROOT::Deprecated::TFTP::AccessPathName(const char *path, EAccessMode mode, Bool_t print)
11121112
{
11131113
if (!IsOpen()) return kTRUE;
11141114

0 commit comments

Comments
 (0)