// Path: wix-embedded-mysql/src/main/java/com/wix/mysql/PackagePaths.java
// public class PackagePaths implements IPackageResolver {
//     @Override
//     public FileSet getFileSet(Distribution distribution) {
//         return com.wix.mysql.distribution.FileSet.emit(
//                 distribution.getPlatform(),
//                 (Version) distribution.getVersion());
//     }
// 
//     @Override
//     public ArchiveType getArchiveType(Distribution distribution) {
//         Version version = (Version)distribution.getVersion();
//         return version.archiveType();
//     }
// 
//     @Override
//     public String getPath(Distribution distribution) {
//         String downloadPath = distribution.getVersion().asInDownloadPath();
//         Version version = (Version)distribution.getVersion();
// 
//         BitSize bs = distribution.getBitsize();
//         switch (distribution.getPlatform()) {
//             case OS_X:
//                 String arch = (String)System.getProperties().get("os.arch");
//                 if (arch.equals("aarch64")) {
//                     bs = B64;
//                 }
//                 return format("%s-x86%s.tar.gz", downloadPath, bs == B32 ? "" : "_64");
//             case Linux:
//                 String gzOrXz = version.archiveType() == TXZ ? "xz" : "gz";
//                 return format("%s-%s.tar.%s", downloadPath, bs == B32 ? "i686" : "x86_64", gzOrXz);
//             case Windows:
//                 return format("%s-win%s.zip", downloadPath, bs == B32 ? "32" : "x64");
//             default:
//                 throw new RuntimeException("Not implemented for: " + distribution.getPlatform());
//         }
//     }
// }
// 
// Path: wix-embedded-mysql/src/main/java/com/wix/mysql/io/ConsoleProgressListener.java
// public class ConsoleProgressListener extends StandardConsoleProgressListener {
// 
//     private ProgressStepper progressStepper = new ProgressStepper();
// 
//     @Override
//     public void progress(String label, int percent) {
//         if (progressStepper.hasNext(percent)) {
//             int percentageToReport = progressStepper.setAndGet(percent);
//             System.out.println(format("%s %d%%", label, percentageToReport));
//         }
//     }
// }


import com.wix.mysql.PackagePaths;
import com.wix.mysql.io.ConsoleProgressListener;
import de.flapdoodle.embed.process.config.store.DownloadPath;
import de.flapdoodle.embed.process.config.store.TimeoutConfigBuilder;
import de.flapdoodle.embed.process.extract.UUIDTempNaming;
import de.flapdoodle.embed.process.io.directories.FixedPath;
package com.wix.mysql.config;


public class DownloadConfigBuilder extends de.flapdoodle.embed.process.config.store.DownloadConfigBuilder {

    public DownloadConfigBuilder defaults(
            final DownloadConfig downloadConfig) {
        fileNaming().setDefault(new UUIDTempNaming());
        downloadPath().setDefault(new DownloadPath(downloadConfig.getBaseUrl()));
        progressListener().setDefault(new ConsoleProgressListener());
        artifactStorePath().setDefault(new FixedPath(downloadConfig.getCacheDir()));
        downloadPrefix().setDefault(new DownloadPrefix("embedmysql-download"));
        userAgent().setDefault(new UserAgent("Mozilla/5.0 (compatible; Embedded MySql; +https://github.com/wix/wix-embedded-mysql)"));
        packageResolver().setDefault(new PackagePaths());
        timeoutConfig().setDefault(new TimeoutConfigBuilder().connectionTimeout(10000).readTimeout(60000).build());
        proxyFactory().setDefault(downloadConfig.getProxyFactory());
// Path: wix-embedded-mysql/src/main/java/com/wix/mysql/PackagePaths.java
// public class PackagePaths implements IPackageResolver {
//     @Override
//     public FileSet getFileSet(Distribution distribution) {
//         return com.wix.mysql.distribution.FileSet.emit(
//                 distribution.getPlatform(),
//                 (Version) distribution.getVersion());
//     }
// 
//     @Override
//     public ArchiveType getArchiveType(Distribution distribution) {
//         Version version = (Version)distribution.getVersion();
//         return version.archiveType();
//     }
// 
//     @Override
//     public String getPath(Distribution distribution) {
//         String downloadPath = distribution.getVersion().asInDownloadPath();
//         Version version = (Version)distribution.getVersion();
// 
//         BitSize bs = distribution.getBitsize();
//         switch (distribution.getPlatform()) {
//             case OS_X:
//                 String arch = (String)System.getProperties().get("os.arch");
//                 if (arch.equals("aarch64")) {
//                     bs = B64;
//                 }
//                 return format("%s-x86%s.tar.gz", downloadPath, bs == B32 ? "" : "_64");
//             case Linux:
//                 String gzOrXz = version.archiveType() == TXZ ? "xz" : "gz";
//                 return format("%s-%s.tar.%s", downloadPath, bs == B32 ? "i686" : "x86_64", gzOrXz);
//             case Windows:
//                 return format("%s-win%s.zip", downloadPath, bs == B32 ? "32" : "x64");
//             default:
//                 throw new RuntimeException("Not implemented for: " + distribution.getPlatform());
//         }
//     }
// }
// 
// Path: wix-embedded-mysql/src/main/java/com/wix/mysql/io/ConsoleProgressListener.java
// public class ConsoleProgressListener extends StandardConsoleProgressListener {
// 
//     private ProgressStepper progressStepper = new ProgressStepper();
// 
//     @Override
//     public void progress(String label, int percent) {
//         if (progressStepper.hasNext(percent)) {
//             int percentageToReport = progressStepper.setAndGet(percent);
//             System.out.println(format("%s %d%%", label, percentageToReport));
//         }
//     }
// }


// Path: wix-embedded-mysql/src/main/java/com/wix/mysql/config/DownloadConfigBuilder.java
import com.wix.mysql.PackagePaths;
import com.wix.mysql.io.ConsoleProgressListener;
import de.flapdoodle.embed.process.config.store.DownloadPath;
import de.flapdoodle.embed.process.config.store.TimeoutConfigBuilder;
import de.flapdoodle.embed.process.extract.UUIDTempNaming;
import de.flapdoodle.embed.process.io.directories.FixedPath;

package com.wix.mysql.config;


public class DownloadConfigBuilder extends de.flapdoodle.embed.process.config.store.DownloadConfigBuilder {

    public DownloadConfigBuilder defaults(
            final DownloadConfig downloadConfig) {
        fileNaming().setDefault(new UUIDTempNaming());
        downloadPath().setDefault(new DownloadPath(downloadConfig.getBaseUrl()));
        progressListener().setDefault(new ConsoleProgressListener());
        artifactStorePath().setDefault(new FixedPath(downloadConfig.getCacheDir()));
        downloadPrefix().setDefault(new DownloadPrefix("embedmysql-download"));
        userAgent().setDefault(new UserAgent("Mozilla/5.0 (compatible; Embedded MySql; +https://github.com/wix/wix-embedded-mysql)"));
        packageResolver().setDefault(new PackagePaths());
        timeoutConfig().setDefault(new TimeoutConfigBuilder().connectionTimeout(10000).readTimeout(60000).build());
        proxyFactory().setDefault(downloadConfig.getProxyFactory());
        return this;