@Override public boolean matches(Version version) { return Platform.detect().isUnixLike(); }
private static ICommandLinePostProcessor privilegedWindowsRunasPostprocessor() { if (Platform.detect().equals(Platform.Windows)) { try { // Based on https://stackoverflow.com/a/11995662 final int adminCommandResult = Runtime.getRuntime().exec("net session").waitFor(); if (adminCommandResult == 0) { return runWithoutPrivileges(); } } catch (Exception e) { // Log maybe? } } return doNothing(); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((bitsize == null) ? 0 : bitsize.hashCode()); result = prime * result + ((platform == null) ? 0 : platform.hashCode()); result = prime * result + ((version == null) ? 0 : version.hashCode()); return result; }
@Override public boolean matches(Platform platform, Version version) { return platform.isUnixLike() && Objects.equals(version.getMajorVersion(), "5.6"); }
private Platform currentPlatform() { return Platform.detect(); }
static String asPath(Distribution distribution) { return new StringBuilder() .append(distribution.getPlatform().name()) .append("-") .append(distribution.getBitsize().name()) .append("--") .append(distribution.getVersion().asInDownloadPath()) .toString(); }
@Override public ArchiveType getArchiveType(Distribution distribution) { return distribution.getPlatform().isUnixLike() ? TGZ : ZIP; }
private void generateNeededDirs() { String[] paths; if (Platform.detect() == Platform.Windows ) { paths = new String[]{"bin", "share/english", "data/test", "data/mysql", "data/performance_schema"}; } else { paths = new String[]{"bin", "scripts", "lib/plugin", "share/english", "share", "support-files"}; } for (String dir : paths) { new File(baseDir + "/" + dir).mkdirs(); } }
private void assertPlatformIsSupported() { if (isMacOsSierra() && !worksOnMacOsSierra()) { throw new UnsupportedPlatformException(String.format("%s is not supported on Mac OS Sierra. Minimum supported version is %s", toString(), v5_7_15.toVersionString())); } if (!supportsCurrentPlatform()) { throw new UnsupportedPlatformException(String.format("Platform %s is not in a supported platform list: %s", currentPlatform().name(), Utils.join(supportedPlatforms, ","))); } }
@Override public boolean matches(Platform platform, Version version) { return platform.isUnixLike() && Objects.equals(version.getMajorVersion(), "5.5"); }
@Override public boolean matches(Version version) { return Platform.detect().isUnixLike() && (version.getMajorVersion().equals("5.6") || version.getMajorVersion().equals("5.5")); }
public static Distribution detectFor(IVersion version) { return new Distribution(version, Platform.detect(), BitSize.detect()); }
static String asPath(Distribution distribution) { return distribution.platform().name() + "-" + distribution.bitsize().name() + "--" + distribution.version().asInDownloadPath(); }
@Override public boolean matches(Platform platform, Version version) { return !platform.isUnixLike() && Objects.equals(version.getMajorVersion(), "5.6"); }
public static Distribution detectFor(Version version) { return of(version, Platform.detect(), BitSize.detect()); }
@Override public boolean matches(Platform platform, Version version) { return platform.isUnixLike() && Objects.equals(version.getMajorVersion(), "5.7") && version.getMinorVersion() > 17; }
private void execute(final String sql) { String command = (Platform.detect() == Windows) ? format("\"%s\"", sql) : sql; try { Process p = new ProcessBuilder(new String[]{
@Override public boolean matches(Platform platform, Version version) { return !platform.isUnixLike() && Objects.equals(version.getMajorVersion(), "5.7") && version.getMinorVersion() > 17; }
if (Platform.detect() == Windows) { Thread.sleep(2000);
@Override public boolean matches(Platform platform, Version version) { return !platform.isUnixLike() && Objects.equals(version.getMajorVersion(), "5.7") && version.getMinorVersion() <= 17; }