78 using Ptr = std::shared_ptr<FileManager>;
85 std::map<std::string, Files::FileProperties>& get_supported_files()
87 auto& var = supported_files_;
90 OperationType get_operation_type()
const{
return operation_type_;}
91 std::string get_directory_base()
const{
return directory_base_;}
92 std::string get_directory_for_temp_files()
const{
return directory_for_temp_files_;}
93 JSON::Object::Ptr& get_result()
98 std::vector<Files::File>& get_files()
104 void set_operation_type(OperationType operation_type){operation_type_ = operation_type;}
105 void set_directory_base(std::string directory_base) { directory_base_ = directory_base;}
106 void set_directory_for_temp_files(std::string directory_for_temp_files) { directory_for_temp_files_ = directory_for_temp_files;}
108 void handlePart(
const MessageHeader& header, std::istream& stream)
override;
109 std::string GenerateName_(std::string name);
114 void DownloadFile_(std::ostream& out_response);
118 void AddBasicSupportedFiles_();
120 Files::File CreateTempFileFromAddress_(std::string address);
121 void ProcessContentLength_();
122 bool VerifyMaxFileSize_();
123 bool ChangePathAndFilename_(
Files::File& file, std::string directory,
bool change_filename =
true);
127 void ProcessFileType_();
128 std::string SplitHeaderValue_(
const MessageHeader& header, std::string header_name, std::string parameter);
129 std::size_t ReplaceText_(std::string& inout, std::string what, std::string with);
132 std::map<std::string, Files::FileProperties> supported_files_;
133 OperationType operation_type_;
134 std::string directory_base_;
135 std::string directory_for_temp_files_;
136 JSON::Object::Ptr result_;
137 std::vector<Files::File> files_;