comparison OrthancFramework/Sources/HttpServer/IWebDavBucket.h @ 4228:c8c0bbaaace3

write access to webdav
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 06 Oct 2020 12:45:11 +0200
parents 7fff7e683d65
children 688435755466
comparison
equal deleted inserted replaced
4227:7fff7e683d65 4228:c8c0bbaaace3
39 39
40 #include <list> 40 #include <list>
41 41
42 namespace Orthanc 42 namespace Orthanc
43 { 43 {
44 class HttpOutput;
45
44 class IWebDavBucket : public boost::noncopyable 46 class IWebDavBucket : public boost::noncopyable
45 { 47 {
46 public: 48 public:
47 class Resource : public boost::noncopyable 49 class Resource : public boost::noncopyable
48 { 50 {
113 MimeType GetMimeType() const 115 MimeType GetMimeType() const
114 { 116 {
115 return mime_; 117 return mime_;
116 } 118 }
117 119
120 void SetCreated(bool created);
121
118 virtual void Format(pugi::xml_node& node, 122 virtual void Format(pugi::xml_node& node,
119 const std::string& parentPath) const ORTHANC_OVERRIDE; 123 const std::string& parentPath) const ORTHANC_OVERRIDE;
120 }; 124 };
121 125
122 126
144 void AddResource(Resource* resource); // Takes ownership 148 void AddResource(Resource* resource); // Takes ownership
145 149
146 void Format(std::string& target, 150 void Format(std::string& target,
147 const std::string& parentPath) const; 151 const std::string& parentPath) const;
148 }; 152 };
149 153
150 154
151 virtual ~IWebDavBucket() 155 virtual ~IWebDavBucket()
152 { 156 {
153 } 157 }
154 158
155 virtual bool IsExistingFolder(const std::vector<std::string>& path) = 0; 159 virtual bool IsExistingFolder(const std::vector<std::string>& path) = 0;
156 160
157 virtual bool ListCollection(Collection& collection, 161 virtual bool ListCollection(Collection& collection,
158 const std::vector<std::string>& path) = 0; 162 const std::vector<std::string>& path) = 0;
159 163
160 virtual bool GetFileContent(std::string& content, 164 virtual bool GetFileContent(MimeType& mime,
165 std::string& content,
166 boost::posix_time::ptime& modificationTime,
161 const std::vector<std::string>& path) = 0; 167 const std::vector<std::string>& path) = 0;
168
169 // "false" returns indicate a read-only target
170 virtual bool StoreFile(const std::string& content,
171 const std::vector<std::string>& path) = 0;
172
173 virtual bool CreateFolder(const std::vector<std::string>& path) = 0;
174
175 virtual void Start() = 0;
176
177 // During the shutdown of the Web server, give a chance to the
178 // bucket to end its pending operations
179 virtual void Stop() = 0;
180
181
182 static void AnswerFakedProppatch(HttpOutput& output,
183 const std::string& uri);
184
185 static void AnswerFakedLock(HttpOutput& output,
186 const std::string& uri);
187
188 static void AnswerFakedUnlock(HttpOutput& output);
162 }; 189 };
163 } 190 }