Fix for outgoing file names being truncated, and renaming input files should not occur, only output files.

PiperOrigin-RevId: 457857046
This commit is contained in:
jfcarroll
2022-06-28 17:41:29 -07:00
committed by Copybara-Service
parent 407222b104
commit bd9d01ec29
4 changed files with 39 additions and 38 deletions
@@ -173,6 +173,11 @@ std::string ImplementationPlatform::GetDownloadPath(std::string& parent_folder,
GetDownloadPathInternal(parent_folder, file_name));
}
std::string ImplementationPlatform::GetDownloadPath(std::string& file_name) {
std::string fake_parent_path;
return GetDownloadPathInternal(fake_parent_path, file_name);
}
OSName ImplementationPlatform::GetCurrentOS() { return OSName::kWindows; }
std::unique_ptr<AtomicBoolean> ImplementationPlatform::CreateAtomicBoolean(
@@ -204,8 +209,8 @@ std::unique_ptr<InputFile> ImplementationPlatform::CreateInputFile(
PayloadId payload_id, std::int64_t total_size) {
std::string parent_folder("");
std::string file_name(std::to_string(payload_id));
return shared::IOFile::CreateInputFile(
GetDownloadPath(parent_folder, file_name), total_size);
return shared::IOFile::CreateInputFile(GetDownloadPath(file_name),
total_size);
}
std::unique_ptr<InputFile> ImplementationPlatform::CreateInputFile(