1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:47:35 +00:00

LibCore: Rename File to DeprecatedFile

As usual, this removes many unused includes and moves used includes
further down the chain.
This commit is contained in:
Tim Schumacher 2023-02-08 21:08:01 +01:00 committed by Linus Groh
parent 14951b92ca
commit d43a7eae54
193 changed files with 536 additions and 556 deletions

View file

@ -14,8 +14,8 @@
#include <AK/StringBuilder.h>
#include <AK/URL.h>
#include <LibCore/DateTime.h>
#include <LibCore/DeprecatedFile.h>
#include <LibCore/DirIterator.h>
#include <LibCore/File.h>
#include <LibCore/MappedFile.h>
#include <LibCore/MimeData.h>
#include <LibHTTP/HttpRequest.h>
@ -132,7 +132,7 @@ ErrorOr<bool> Client::handle_request(ReadonlyBytes raw_request)
path_builder.append(requested_path);
auto real_path = TRY(path_builder.to_string());
if (Core::File::is_directory(real_path.bytes_as_string_view())) {
if (Core::DeprecatedFile::is_directory(real_path.bytes_as_string_view())) {
if (!resource_decoded.ends_with('/')) {
StringBuilder red;
@ -147,14 +147,14 @@ ErrorOr<bool> Client::handle_request(ReadonlyBytes raw_request)
index_html_path_builder.append(real_path);
index_html_path_builder.append("/index.html"sv);
auto index_html_path = TRY(index_html_path_builder.to_string());
if (!Core::File::exists(index_html_path)) {
if (!Core::DeprecatedFile::exists(index_html_path)) {
TRY(handle_directory_listing(requested_path, real_path, request));
return true;
}
real_path = index_html_path;
}
auto file = Core::File::construct(real_path.bytes_as_string_view());
auto file = Core::DeprecatedFile::construct(real_path.bytes_as_string_view());
if (!file->open(Core::OpenMode::ReadOnly)) {
TRY(send_error_response(404, request));
return false;
@ -169,7 +169,7 @@ ErrorOr<bool> Client::handle_request(ReadonlyBytes raw_request)
auto const info = ContentInfo {
.type = TRY(String::from_deprecated_string(Core::guess_mime_type_based_on_filename(real_path.bytes_as_string_view()))),
.length = TRY(Core::File::size(real_path.bytes_as_string_view()))
.length = TRY(Core::DeprecatedFile::size(real_path.bytes_as_string_view()))
};
TRY(send_response(*stream, request, move(info)));
return true;