annotate OrthancFramework/Sources/HttpServer/WebDavStorage.h @ 5317:9875e1f24394

added XC in the modality list
author Alain Mazy <am@osimis.io>
date Thu, 22 Jun 2023 21:30:45 +0200
parents 0ea402b4d901
children 48b8dae6dc77
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4230
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
5185
0ea402b4d901 upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4870
diff changeset
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
0ea402b4d901 upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4870
diff changeset
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
4230
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 *
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8 * This program is free software: you can redistribute it and/or
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * modify it under the terms of the GNU Lesser General Public License
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * as published by the Free Software Foundation, either version 3 of
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 * the License, or (at your option) any later version.
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 *
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * This program is distributed in the hope that it will be useful, but
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
16 * Lesser General Public License for more details.
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 *
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * You should have received a copy of the GNU Lesser General Public
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 * License along with this program. If not, see
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 * <http://www.gnu.org/licenses/>.
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 **/
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #pragma once
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 #include "IWebDavBucket.h"
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 #include <boost/thread/recursive_mutex.hpp>
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 namespace Orthanc
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32 {
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 class WebDavStorage : public IWebDavBucket
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 {
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 private:
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 class StorageFile;
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
37 class StorageFolder;
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
38
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
39 StorageFolder* LookupParentFolder(const std::vector<std::string>& path);
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
40
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
41 boost::shared_ptr<StorageFolder> root_; // PImpl
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
42 boost::recursive_mutex mutex_;
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
43 bool isMemory_;
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 public:
4253
2221051b42df cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4239
diff changeset
46 explicit WebDavStorage(bool isMemory);
4230
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 virtual bool IsExistingFolder(const std::vector<std::string>& path) ORTHANC_OVERRIDE;
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 virtual bool ListCollection(Collection& collection,
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51 const std::vector<std::string>& path) ORTHANC_OVERRIDE;
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53 virtual bool GetFileContent(MimeType& mime,
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 std::string& content,
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 boost::posix_time::ptime& modificationTime,
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 const std::vector<std::string>& path) ORTHANC_OVERRIDE;
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 virtual bool StoreFile(const std::string& content,
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 const std::vector<std::string>& path) ORTHANC_OVERRIDE;
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 virtual bool CreateFolder(const std::vector<std::string>& path) ORTHANC_OVERRIDE;
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62
4232
688435755466 added DELETE in WebDAV, first working virtual filesystem
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4230
diff changeset
63 virtual bool DeleteItem(const std::vector<std::string>& path) ORTHANC_OVERRIDE;
688435755466 added DELETE in WebDAV, first working virtual filesystem
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4230
diff changeset
64
4230
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 virtual void Start() ORTHANC_OVERRIDE
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66 {
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 }
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 virtual void Stop() ORTHANC_OVERRIDE
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 {
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 }
4239
c8754c4c1862 upload DICOM using WebDAV
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4232
diff changeset
72
c8754c4c1862 upload DICOM using WebDAV
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4232
diff changeset
73 void RemoveEmptyFolders();
4230
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 };
b313a0001893 WebDavStorage
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 }