Mercurial > hg > orthanc
comparison Core/HttpServer/FilesystemHttpHandler.cpp @ 59:c996319e90bc orthanc-renaming
renaming in Core
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sun, 16 Sep 2012 09:28:56 +0200 |
parents | a15e90e5d6fc |
children | fd7b0a3e6260 |
comparison
equal
deleted
inserted
replaced
58:6da7fc87efaa | 59:c996319e90bc |
---|---|
1 /** | 1 /** |
2 * Palanthir - A Lightweight, RESTful DICOM Store | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
3 * Copyright (C) 2012 Medical Physics Department, CHU of Liege, | 3 * Copyright (C) 2012 Medical Physics Department, CHU of Liege, |
4 * Belgium | 4 * Belgium |
5 * | 5 * |
6 * This program is free software: you can redistribute it and/or | 6 * This program is free software: you can redistribute it and/or |
7 * modify it under the terms of the GNU General Public License as | 7 * modify it under the terms of the GNU General Public License as |
18 **/ | 18 **/ |
19 | 19 |
20 | 20 |
21 #include "FilesystemHttpHandler.h" | 21 #include "FilesystemHttpHandler.h" |
22 | 22 |
23 #include "../PalanthirException.h" | 23 #include "../OrthancException.h" |
24 | 24 |
25 #include <boost/filesystem.hpp> | 25 #include <boost/filesystem.hpp> |
26 | 26 |
27 | 27 |
28 namespace Palanthir | 28 namespace Orthanc |
29 { | 29 { |
30 struct FilesystemHttpHandler::PImpl | 30 struct FilesystemHttpHandler::PImpl |
31 { | 31 { |
32 UriComponents baseUri_; | 32 UriComponents baseUri_; |
33 boost::filesystem::path root_; | 33 boost::filesystem::path root_; |
89 | 89 |
90 namespace fs = boost::filesystem; | 90 namespace fs = boost::filesystem; |
91 if (!fs::exists(pimpl_->root_) || | 91 if (!fs::exists(pimpl_->root_) || |
92 !fs::is_directory(pimpl_->root_)) | 92 !fs::is_directory(pimpl_->root_)) |
93 { | 93 { |
94 throw PalanthirException("The path does not point to a directory"); | 94 throw OrthancException("The path does not point to a directory"); |
95 } | 95 } |
96 } | 96 } |
97 | 97 |
98 | 98 |
99 bool FilesystemHttpHandler::IsServedUri(const UriComponents& uri) | 99 bool FilesystemHttpHandler::IsServedUri(const UriComponents& uri) |
134 { | 134 { |
135 OutputDirectoryContent(output, uri, p); | 135 OutputDirectoryContent(output, uri, p); |
136 } | 136 } |
137 else | 137 else |
138 { | 138 { |
139 output.SendHeader(Palanthir_HttpStatus_404_NotFound); | 139 output.SendHeader(Orthanc_HttpStatus_404_NotFound); |
140 } | 140 } |
141 } | 141 } |
142 } | 142 } |