package com.wix.mysql.config;

import com.wix.mysql.PackagePaths;
import de.flapdoodle.embed.process.config.store.DownloadPath;
import de.flapdoodle.embed.process.distribution.Platform;
import de.flapdoodle.embed.process.extract.UUIDTempNaming;
import de.flapdoodle.embed.process.io.directories.UserHome;
import de.flapdoodle.embed.process.io.progress.ConsoleOneLineProgressListener;
import de.flapdoodle.embed.process.io.progress.StandardConsoleProgressListener;

/**
 * @author viliusl
 * @since 27/09/14
 */
public class DownloadConfigBuilder extends de.flapdoodle.embed.process.config.store.DownloadConfigBuilder {

    public DownloadConfigBuilder defaults() {
        fileNaming().setDefault(new UUIDTempNaming());
        downloadPath().setDefault(new DownloadPath("http://dev.mysql.com/get/Downloads/"));
        progressListener().setDefault(Platform.detect() == Platform.OS_X ? new ConsoleOneLineProgressListener() : new StandardConsoleProgressListener());
        artifactStorePath().setDefault(new UserHome(".embedmysql"));
        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());
        return this;
    }
}

@@ -121,16 +121,86 @@
 adPath;%0A
+import de.flapdoodle.embed.process.config.store.TimeoutConfigBuilder;%0A
 import d
@@ -1368,24 +1368,140 @@
 gePaths());%0A
+        timeoutConfig().setDefault(new TimeoutConfigBuilder().connectionTimeout(10000).readTimeout(60000).build());%0A
         retu

set more lenient download timeout values