private boolean downloadModule(ModuleConfig module) {
        LOGGER.info("download module {}({}) begin with url {}", module.getId(), module.getName(),
                module.getPackageConfig().getDownloadUrl());
        try {
            URL url = new URL(module.getPackageConfig().getDownloadUrl());
            URLConnection conn = url.openConnection();
            Map<String, String> authHeader = httpManager.getAuthHeader();
            authHeader.forEach((k, v) -> {
                conn.setRequestProperty(k, v);
            });
            String saveFolder = getRealPath(module.getPackageConfig().getStoragePath());
            File folder = new File(saveFolder);
            if (!folder.exists()) {
                boolean folderCreated = folder.mkdirs();
                if (folderCreated) {
                    LOGGER.info("saveFolder {} created", saveFolder);
                } else {
                    LOGGER.error("failed to create saveFolder {}", saveFolder);
                }
            }
            String path = saveFolder + "/" + module.getPackageConfig().getFileName();
            try (InputStream inputStream = conn.getInputStream();
                    FileOutputStream outputStream = new FileOutputStream(path)) {
                LOGGER.info("module {}({}) save path {}", module.getId(), module.getName(), path);
                int byteRead;
                byte[] buffer = new byte[DOWNLOAD_PACKAGE_READ_BUFF_SIZE];
                while ((byteRead = inputStream.read(buffer)) != -1) {
                    outputStream.write(buffer, 0, byteRead);
                }
            }
            if (isPackageDownloaded(module)) {
                return true;
            } else {
                LOGGER.error("download module {}({}) package md5 not match!", module.getId(), module.getName());
                return false;
            }
        } catch (FileNotFoundException e) {
            LOGGER.error("download module {}({}) err", module.getId(), module.getName(), e);
        } catch (IOException e) {
            LOGGER.error("download module {}({}) err", module.getId(), module.getName(), e);
        }
        LOGGER.info("download module {}({}) end", module.getId(), module.getName());
        return false;
    }
Thread for core thread.

@return runnable profile.
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java