KaliVeda
Toolkit for HIC analysis
KVDMSDataRepositoryImpl.cpp
1 //Created by KVClassFactory on Thu Oct 18 10:38:52 2012
2 //Author: John Frankland
3 
4 #include "KVDMSDataRepositoryImpl.h"
5 #include "KVDMS.h"
6 #include "KVDataSet.h"
7 
8 using namespace std;
9 
11 
12 
13 
17 {
18  // Default constructor
19  SetType("dms");
20 }
21 
22 
23 
25 
26 int KVDMSDataRepositoryImpl::copy_file_from(const TString& source, const TString& destination) const
27 {
28  return fDMS->get(source, destination);
29 }
30 
31 
32 
34 
35 int KVDMSDataRepositoryImpl::copy_file_to(const TString& source, const TString& destination) const
36 {
37  return fDMS->put(source, destination);
38 }
39 
40 
41 
43 
45 {
46  fDMS->mkdir(path.Data());
47 }
48 
49 
50 
59 
61 {
62  //Use the DMS catalogue in order to examine the directory
63  //
64  // /root_of_data_repository/[datasetdir]/[datatype]/[subdir]
65  // /root_of_data_repository/[datasetdir]/[datatype] (if subdir="", default value)
66  // /root_of_data_repository/[datasetdir] (if datatype="", default value)
67  //
68  //and fill a TList with one KVDMSFile_t object for each entry in the directory,
69 
70  return fDMS->GetFullListing(path.Data());
71 }
72 
73 
74 
76 
78 {
79  return fDMS->forcedelete(path.Data());
80 }
81 
82 
83 
84 
87 
88 int KVDMSDataRepositoryImpl::Chmod(const char* file, UInt_t mode) const
89 {
90  // Overrides KVDataRepository method.
91  return fDMS->chmod(file, mode);
92 }
93 
94 
95 
102 
104 {
105  // \warning only fs.fSize and fs.fMtime are used.
106  // In addition, the modification time corresponds to the last time that
107  // the DMS declaration of the file was changed, not the last physical
108  // modification of the file, i.e. it will be the date at which the file
109  // was imported into the DMS catalogue, the file may be much older.
110 
111  DMSFile_t DMSfile;
112  if (fDMS->GetPathInfo(path, DMSfile)) {
113  fs.fSize = DMSfile.GetSize();
114  fs.fMtime = DMSfile.GetModTime().Convert();
115  return kTRUE;
116  }
117  return kFALSE;
118 }
119 
120 
121 
123 
125 {
126  return fDMS->DirectoryContains(gSystem->BaseName(path), gSystem->DirName(path));
127 }
128 
129 
unsigned int UInt_t
bool Bool_t
constexpr Bool_t kFALSE
constexpr Bool_t kTRUE
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize fs
R__EXTERN TSystem * gSystem
UInt_t GetSize() const
Definition: KVDMS.h:52
KVDatime GetModTime() const
Definition: KVDMS.h:44
Manage remote data repository using a Data Management System.
KVUniqueNameList get_directory_listing(const TString &path) const override
int Chmod(const char *file, UInt_t mode) const override
Overrides KVDataRepository method.
int copy_file_from(const TString &source, const TString &destination) const override
void make_directory(const TString &path) const override
int delete_file(const TString &path) const override
int copy_file_to(const TString &source, const TString &destination) const override
Bool_t GetPathInfo(const TString &, FileStat_t &) const override
Bool_t check_path_exists(const TString &) const override
Optimised list in which named objects can only be placed once.
UInt_t Convert(Bool_t toGMT=kFALSE) const
const char * Data() const
virtual const char * DirName(const char *pathname)
virtual const char * BaseName(const char *pathname)
ClassImp(TPyArg)