summaryrefslogtreecommitdiff
path: root/archived/projt-launcher/launcher/java/download
diff options
context:
space:
mode:
authorMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 18:51:45 +0300
committerMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 18:51:45 +0300
commitd3261e64152397db2dca4d691a990c6bc2a6f4dd (patch)
treefac2f7be638651181a72453d714f0f96675c2b8b /archived/projt-launcher/launcher/java/download
parent31b9a8949ed0a288143e23bf739f2eb64fdc63be (diff)
downloadProject-Tick-d3261e64152397db2dca4d691a990c6bc2a6f4dd.tar.gz
Project-Tick-d3261e64152397db2dca4d691a990c6bc2a6f4dd.zip
NOISSUE add archived projects
Signed-off-by: Mehmet Samet Duman <yongdohyun@projecttick.org>
Diffstat (limited to 'archived/projt-launcher/launcher/java/download')
-rw-r--r--archived/projt-launcher/launcher/java/download/RuntimeArchiveTask.cpp174
-rw-r--r--archived/projt-launcher/launcher/java/download/RuntimeArchiveTask.hpp55
-rw-r--r--archived/projt-launcher/launcher/java/download/RuntimeLinkTask.cpp101
-rw-r--r--archived/projt-launcher/launcher/java/download/RuntimeLinkTask.hpp40
-rw-r--r--archived/projt-launcher/launcher/java/download/RuntimeManifestTask.cpp184
-rw-r--r--archived/projt-launcher/launcher/java/download/RuntimeManifestTask.hpp55
6 files changed, 609 insertions, 0 deletions
diff --git a/archived/projt-launcher/launcher/java/download/RuntimeArchiveTask.cpp b/archived/projt-launcher/launcher/java/download/RuntimeArchiveTask.cpp
new file mode 100644
index 0000000000..9ab74afe62
--- /dev/null
+++ b/archived/projt-launcher/launcher/java/download/RuntimeArchiveTask.cpp
@@ -0,0 +1,174 @@
+// SPDX-License-Identifier: GPL-3.0-only
+// SPDX-FileCopyrightText: 2026 Project Tick
+// SPDX-FileContributor: Project Tick Team
+/*
+ * ProjT Launcher - Minecraft Launcher
+ * Copyright (C) 2026 Project Tick
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+#include "java/download/RuntimeArchiveTask.hpp"
+
+#include <QDir>
+#include <QFile>
+#include <memory>
+#include <quazip.h>
+
+#include "Application.h"
+#include "MMCZip.h"
+#include "Untar.h"
+#include "net/ChecksumValidator.h"
+#include "net/NetJob.h"
+
+namespace projt::java
+{
+ RuntimeArchiveTask::RuntimeArchiveTask(QUrl url, QString finalPath, QString checksumType, QString checksumHash)
+ : m_url(url),
+ m_final_path(std::move(finalPath)),
+ m_checksum_type(std::move(checksumType)),
+ m_checksum_hash(std::move(checksumHash))
+ {}
+
+ void RuntimeArchiveTask::executeTask()
+ {
+ setStatus(tr("Downloading Java"));
+
+ MetaEntryPtr entry = APPLICATION->metacache()->resolveEntry("java", m_url.fileName());
+
+ auto download = makeShared<NetJob>(QString("JRE::DownloadJava"), APPLICATION->network());
+ auto action = Net::Download::makeCached(m_url, entry);
+ if (!m_checksum_hash.isEmpty() && !m_checksum_type.isEmpty())
+ {
+ auto hashType = QCryptographicHash::Algorithm::Sha1;
+ if (m_checksum_type == "sha256")
+ {
+ hashType = QCryptographicHash::Algorithm::Sha256;
+ }
+ action->addValidator(new Net::ChecksumValidator(hashType, QByteArray::fromHex(m_checksum_hash.toUtf8())));
+ }
+ download->addNetAction(action);
+ auto fullPath = entry->getFullPath();
+
+ connect(download.get(), &Task::failed, this, &RuntimeArchiveTask::emitFailed);
+ connect(download.get(), &Task::progress, this, &RuntimeArchiveTask::setProgress);
+ connect(download.get(), &Task::stepProgress, this, &RuntimeArchiveTask::propagateStepProgress);
+ connect(download.get(), &Task::status, this, &RuntimeArchiveTask::setStatus);
+ connect(download.get(), &Task::details, this, &RuntimeArchiveTask::setDetails);
+ connect(download.get(), &Task::aborted, this, &RuntimeArchiveTask::emitAborted);
+ connect(download.get(), &Task::succeeded, this, [this, fullPath] { extractRuntime(fullPath); });
+ m_task = download;
+ m_task->start();
+ }
+
+ void RuntimeArchiveTask::extractRuntime(QString input)
+ {
+ setStatus(tr("Extracting Java"));
+ if (input.endsWith("tar"))
+ {
+ setStatus(tr("Extracting Java (Progress is not reported for tar archives)"));
+ QFile in(input);
+ if (!in.open(QFile::ReadOnly))
+ {
+ emitFailed(tr("Unable to open supplied tar file."));
+ return;
+ }
+ if (!Tar::extract(&in, QDir(m_final_path).absolutePath()))
+ {
+ emitFailed(tr("Unable to extract supplied tar file."));
+ return;
+ }
+ emitSucceeded();
+ return;
+ }
+ if (input.endsWith("tar.gz") || input.endsWith("taz") || input.endsWith("tgz"))
+ {
+ setStatus(tr("Extracting Java (Progress is not reported for tar archives)"));
+ if (!GZTar::extract(input, QDir(m_final_path).absolutePath()))
+ {
+ emitFailed(tr("Unable to extract supplied tar file."));
+ return;
+ }
+ emitSucceeded();
+ return;
+ }
+ if (input.endsWith("zip"))
+ {
+ auto zip = std::make_shared<QuaZip>(input);
+ if (!zip->open(QuaZip::mdUnzip))
+ {
+ emitFailed(tr("Unable to open supplied zip file."));
+ return;
+ }
+ auto files = zip->getFileNameList();
+ if (files.isEmpty())
+ {
+ emitFailed(tr("No files were found in the supplied zip file."));
+ return;
+ }
+ m_task = makeShared<MMCZip::ExtractZipTask>(zip, m_final_path, files[0]);
+
+ auto progressStep = std::make_shared<TaskStepProgress>();
+ connect(m_task.get(),
+ &Task::finished,
+ this,
+ [this, progressStep]
+ {
+ progressStep->state = TaskStepState::Succeeded;
+ stepProgress(*progressStep);
+ });
+
+ connect(m_task.get(), &Task::succeeded, this, &RuntimeArchiveTask::emitSucceeded);
+ connect(m_task.get(), &Task::aborted, this, &RuntimeArchiveTask::emitAborted);
+ connect(m_task.get(),
+ &Task::failed,
+ this,
+ [this, progressStep](QString reason)
+ {
+ progressStep->state = TaskStepState::Failed;
+ stepProgress(*progressStep);
+ emitFailed(reason);
+ });
+ connect(m_task.get(), &Task::stepProgress, this, &RuntimeArchiveTask::propagateStepProgress);
+
+ connect(m_task.get(),
+ &Task::progress,
+ this,
+ [this, progressStep](qint64 current, qint64 total)
+ {
+ progressStep->update(current, total);
+ stepProgress(*progressStep);
+ });
+ connect(m_task.get(),
+ &Task::status,
+ this,
+ [this, progressStep](QString status)
+ {
+ progressStep->status = status;
+ stepProgress(*progressStep);
+ });
+ m_task->start();
+ return;
+ }
+
+ emitFailed(tr("Could not determine archive type!"));
+ }
+
+ bool RuntimeArchiveTask::abort()
+ {
+ auto aborted = canAbort();
+ if (m_task)
+ aborted = m_task->abort();
+ return aborted;
+ }
+} // namespace projt::java
diff --git a/archived/projt-launcher/launcher/java/download/RuntimeArchiveTask.hpp b/archived/projt-launcher/launcher/java/download/RuntimeArchiveTask.hpp
new file mode 100644
index 0000000000..6aa524ceb2
--- /dev/null
+++ b/archived/projt-launcher/launcher/java/download/RuntimeArchiveTask.hpp
@@ -0,0 +1,55 @@
+// SPDX-License-Identifier: GPL-3.0-only
+// SPDX-FileCopyrightText: 2026 Project Tick
+// SPDX-FileContributor: Project Tick Team
+/*
+ * ProjT Launcher - Minecraft Launcher
+ * Copyright (C) 2026 Project Tick
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+#pragma once
+
+#include <QUrl>
+
+#include "tasks/Task.h"
+
+namespace projt::java
+{
+ class RuntimeArchiveTask : public Task
+ {
+ Q_OBJECT
+ public:
+ RuntimeArchiveTask(QUrl url, QString finalPath, QString checksumType = "", QString checksumHash = "");
+ ~RuntimeArchiveTask() override = default;
+
+ bool canAbort() const override
+ {
+ return true;
+ }
+
+ bool abort() override;
+
+ protected:
+ void executeTask() override;
+
+ private:
+ void extractRuntime(QString input);
+
+ QUrl m_url;
+ QString m_final_path;
+ QString m_checksum_type;
+ QString m_checksum_hash;
+ Task::Ptr m_task;
+ };
+} // namespace projt::java
diff --git a/archived/projt-launcher/launcher/java/download/RuntimeLinkTask.cpp b/archived/projt-launcher/launcher/java/download/RuntimeLinkTask.cpp
new file mode 100644
index 0000000000..fd5b381044
--- /dev/null
+++ b/archived/projt-launcher/launcher/java/download/RuntimeLinkTask.cpp
@@ -0,0 +1,101 @@
+// SPDX-License-Identifier: GPL-3.0-only
+// SPDX-FileCopyrightText: 2026 Project Tick
+// SPDX-FileContributor: Project Tick Team
+/*
+ * ProjT Launcher - Minecraft Launcher
+ * Copyright (C) 2026 Project Tick
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+#include "java/download/RuntimeLinkTask.hpp"
+
+#include <QDir>
+#include <QFileInfo>
+
+#include "FileSystem.h"
+
+namespace
+{
+ QString findBinPath(const QString& root, const QString& pattern)
+ {
+ auto path = FS::PathCombine(root, pattern);
+ if (QFileInfo::exists(path))
+ {
+ return path;
+ }
+
+ auto entries = QDir(root).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot);
+ for (auto& entry : entries)
+ {
+ path = FS::PathCombine(entry.absoluteFilePath(), pattern);
+ if (QFileInfo::exists(path))
+ {
+ return path;
+ }
+ }
+
+ return {};
+ }
+} // namespace
+
+namespace projt::java
+{
+ RuntimeLinkTask::RuntimeLinkTask(QString finalPath) : m_path(std::move(finalPath))
+ {}
+
+ void RuntimeLinkTask::executeTask()
+ {
+ setStatus(tr("Checking for Java binary path"));
+ const auto binPath = FS::PathCombine("bin", "java");
+ const auto wantedPath = FS::PathCombine(m_path, binPath);
+ if (QFileInfo::exists(wantedPath))
+ {
+ emitSucceeded();
+ return;
+ }
+
+ setStatus(tr("Searching for Java binary path"));
+ const auto contentsPartialPath = FS::PathCombine("Contents", "Home", binPath);
+ const auto relativePathToBin = findBinPath(m_path, contentsPartialPath);
+ if (relativePathToBin.isEmpty())
+ {
+ emitFailed(tr("Failed to find Java binary path"));
+ return;
+ }
+ const auto folderToLink = relativePathToBin.chopped(binPath.length());
+
+ setStatus(tr("Collecting folders to symlink"));
+ auto entries = QDir(folderToLink).entryInfoList(QDir::NoDotAndDotDot | QDir::AllEntries);
+ QList<FS::LinkPair> files;
+ setProgress(0, entries.length());
+ for (auto& entry : entries)
+ {
+ files.append({ entry.absoluteFilePath(), FS::PathCombine(m_path, entry.fileName()) });
+ }
+
+ setStatus(tr("Symlinking Java binary path"));
+ FS::create_link folderLink(files);
+ connect(&folderLink,
+ &FS::create_link::fileLinked,
+ [this](QString, QString) { setProgress(m_progress + 1, m_progressTotal); });
+ if (!folderLink())
+ {
+ emitFailed(folderLink.getOSError().message().c_str());
+ }
+ else
+ {
+ emitSucceeded();
+ }
+ }
+} // namespace projt::java
diff --git a/archived/projt-launcher/launcher/java/download/RuntimeLinkTask.hpp b/archived/projt-launcher/launcher/java/download/RuntimeLinkTask.hpp
new file mode 100644
index 0000000000..d4daf98a04
--- /dev/null
+++ b/archived/projt-launcher/launcher/java/download/RuntimeLinkTask.hpp
@@ -0,0 +1,40 @@
+// SPDX-License-Identifier: GPL-3.0-only
+// SPDX-FileCopyrightText: 2026 Project Tick
+// SPDX-FileContributor: Project Tick Team
+/*
+ * ProjT Launcher - Minecraft Launcher
+ * Copyright (C) 2026 Project Tick
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+#pragma once
+
+#include "tasks/Task.h"
+
+namespace projt::java
+{
+ class RuntimeLinkTask : public Task
+ {
+ Q_OBJECT
+ public:
+ explicit RuntimeLinkTask(QString finalPath);
+ ~RuntimeLinkTask() override = default;
+
+ protected:
+ void executeTask() override;
+
+ private:
+ QString m_path;
+ };
+} // namespace projt::java \ No newline at end of file
diff --git a/archived/projt-launcher/launcher/java/download/RuntimeManifestTask.cpp b/archived/projt-launcher/launcher/java/download/RuntimeManifestTask.cpp
new file mode 100644
index 0000000000..3776078ecf
--- /dev/null
+++ b/archived/projt-launcher/launcher/java/download/RuntimeManifestTask.cpp
@@ -0,0 +1,184 @@
+// SPDX-License-Identifier: GPL-3.0-only
+// SPDX-FileCopyrightText: 2026 Project Tick
+// SPDX-FileContributor: Project Tick Team
+/*
+ * ProjT Launcher - Minecraft Launcher
+ * Copyright (C) 2026 Project Tick
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+#include "java/download/RuntimeManifestTask.hpp"
+
+#include <QFile>
+#include <QJsonDocument>
+
+#include "Application.h"
+#include "FileSystem.h"
+#include "Json.h"
+#include "net/ChecksumValidator.h"
+#include "net/NetJob.h"
+
+namespace
+{
+ struct FileEntry
+ {
+ QString path;
+ QString url;
+ QByteArray hash;
+ bool isExec = false;
+ };
+} // namespace
+
+namespace projt::java
+{
+ RuntimeManifestTask::RuntimeManifestTask(QUrl url, QString finalPath, QString checksumType, QString checksumHash)
+ : m_url(url),
+ m_final_path(std::move(finalPath)),
+ m_checksum_type(std::move(checksumType)),
+ m_checksum_hash(std::move(checksumHash))
+ {}
+
+ void RuntimeManifestTask::executeTask()
+ {
+ setStatus(tr("Downloading Java"));
+ auto download = makeShared<NetJob>(QString("JRE::DownloadJava"), APPLICATION->network());
+ auto files = std::make_shared<QByteArray>();
+
+ auto action = Net::Download::makeByteArray(m_url, files);
+ if (!m_checksum_hash.isEmpty() && !m_checksum_type.isEmpty())
+ {
+ auto hashType = QCryptographicHash::Algorithm::Sha1;
+ if (m_checksum_type == "sha256")
+ {
+ hashType = QCryptographicHash::Algorithm::Sha256;
+ }
+ action->addValidator(new Net::ChecksumValidator(hashType, QByteArray::fromHex(m_checksum_hash.toUtf8())));
+ }
+ download->addNetAction(action);
+
+ connect(download.get(), &Task::failed, this, &RuntimeManifestTask::emitFailed);
+ connect(download.get(), &Task::progress, this, &RuntimeManifestTask::setProgress);
+ connect(download.get(), &Task::stepProgress, this, &RuntimeManifestTask::propagateStepProgress);
+ connect(download.get(), &Task::status, this, &RuntimeManifestTask::setStatus);
+ connect(download.get(), &Task::details, this, &RuntimeManifestTask::setDetails);
+
+ connect(download.get(),
+ &Task::succeeded,
+ [files, this]
+ {
+ QJsonParseError parse_error{};
+ QJsonDocument doc = QJsonDocument::fromJson(*files, &parse_error);
+ if (parse_error.error != QJsonParseError::NoError)
+ {
+ qWarning() << "Error while parsing JSON response at " << parse_error.offset
+ << ". Reason: " << parse_error.errorString();
+ qWarning() << *files;
+ emitFailed(parse_error.errorString());
+ return;
+ }
+ downloadRuntime(doc);
+ });
+ m_task = download;
+ m_task->start();
+ }
+
+ void RuntimeManifestTask::downloadRuntime(const QJsonDocument& doc)
+ {
+ FS::ensureFolderPathExists(m_final_path);
+ std::vector<FileEntry> toDownload;
+ auto list = Json::ensureObject(Json::ensureObject(doc.object()), "files");
+ for (const auto& pathKey : list.keys())
+ {
+ auto filePath = FS::PathCombine(m_final_path, pathKey);
+ const QJsonObject& meta = Json::ensureObject(list, pathKey);
+ auto type = Json::ensureString(meta, "type");
+ if (type == "directory")
+ {
+ FS::ensureFolderPathExists(filePath);
+ }
+ else if (type == "link")
+ {
+ auto target = Json::ensureString(meta, "target");
+ if (!target.isEmpty())
+ {
+ QFile::link(target, filePath);
+ }
+ }
+ else if (type == "file")
+ {
+ auto downloads = Json::ensureObject(meta, "downloads");
+ auto isExec = Json::ensureBoolean(meta, "executable", false);
+ QString url;
+ QByteArray hash;
+
+ if (downloads.contains("raw"))
+ {
+ auto raw = Json::ensureObject(downloads, "raw");
+ url = Json::ensureString(raw, "url");
+ hash = QByteArray::fromHex(Json::ensureString(raw, "sha1").toLatin1());
+ }
+ else
+ {
+ qWarning() << "No raw download available for file:" << pathKey;
+ qWarning() << "Skipping file without raw download - decompression not yet supported";
+ continue;
+ }
+
+ if (!url.isEmpty() && QUrl(url).isValid())
+ {
+ toDownload.push_back({ filePath, url, hash, isExec });
+ }
+ }
+ }
+ auto elementDownload = makeShared<NetJob>("JRE::FileDownload", APPLICATION->network());
+ for (const auto& file : toDownload)
+ {
+ auto dl = Net::Download::makeFile(file.url, file.path);
+ if (!file.hash.isEmpty())
+ {
+ dl->addValidator(new Net::ChecksumValidator(QCryptographicHash::Sha1, file.hash));
+ }
+ if (file.isExec)
+ {
+ connect(dl.get(),
+ &Net::Download::succeeded,
+ [file]
+ {
+ QFile(file.path).setPermissions(QFile(file.path).permissions()
+ | QFileDevice::Permissions(0x1111));
+ });
+ }
+ elementDownload->addNetAction(dl);
+ }
+
+ connect(elementDownload.get(), &Task::failed, this, &RuntimeManifestTask::emitFailed);
+ connect(elementDownload.get(), &Task::progress, this, &RuntimeManifestTask::setProgress);
+ connect(elementDownload.get(), &Task::stepProgress, this, &RuntimeManifestTask::propagateStepProgress);
+ connect(elementDownload.get(), &Task::status, this, &RuntimeManifestTask::setStatus);
+ connect(elementDownload.get(), &Task::details, this, &RuntimeManifestTask::setDetails);
+
+ connect(elementDownload.get(), &Task::succeeded, this, &RuntimeManifestTask::emitSucceeded);
+ m_task = elementDownload;
+ m_task->start();
+ }
+
+ bool RuntimeManifestTask::abort()
+ {
+ auto aborted = canAbort();
+ if (m_task)
+ aborted = m_task->abort();
+ emitAborted();
+ return aborted;
+ }
+} // namespace projt::java
diff --git a/archived/projt-launcher/launcher/java/download/RuntimeManifestTask.hpp b/archived/projt-launcher/launcher/java/download/RuntimeManifestTask.hpp
new file mode 100644
index 0000000000..6eb8427dbe
--- /dev/null
+++ b/archived/projt-launcher/launcher/java/download/RuntimeManifestTask.hpp
@@ -0,0 +1,55 @@
+// SPDX-License-Identifier: GPL-3.0-only
+// SPDX-FileCopyrightText: 2026 Project Tick
+// SPDX-FileContributor: Project Tick Team
+/*
+ * ProjT Launcher - Minecraft Launcher
+ * Copyright (C) 2026 Project Tick
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+#pragma once
+
+#include <QUrl>
+
+#include "tasks/Task.h"
+
+namespace projt::java
+{
+ class RuntimeManifestTask : public Task
+ {
+ Q_OBJECT
+ public:
+ RuntimeManifestTask(QUrl url, QString finalPath, QString checksumType = "", QString checksumHash = "");
+ ~RuntimeManifestTask() override = default;
+
+ bool canAbort() const override
+ {
+ return true;
+ }
+
+ bool abort() override;
+
+ protected:
+ void executeTask() override;
+
+ private:
+ void downloadRuntime(const QJsonDocument& doc);
+
+ QUrl m_url;
+ QString m_final_path;
+ QString m_checksum_type;
+ QString m_checksum_hash;
+ Task::Ptr m_task;
+ };
+} // namespace projt::java \ No newline at end of file