public static PackageInstallerBuilder create(OperatingSystem os) {
   if (OperatingSystemPredicates.supportsApt().apply(os)) return new AptPackageInstaller();
   else if (OperatingSystemPredicates.supportsYum().apply(os)) return new YumPackageInstaller();
   else if (OperatingSystemPredicates.supportsZypper().apply(os))
     return new ZypperPackageInstaller();
   else throw new IllegalArgumentException("don't know how to handle" + os.toString());
 }
コード例 #2
0
 /**
  * @deprecated since 0.7; see {@link BashCommands#installJava7()} and {@link
  *     BashCommands#INSTALL_CURL}
  */
 @Deprecated
 public static Statement installJavaAndCurl(OperatingSystem os) {
   if (os == null || OperatingSystemPredicates.supportsApt().apply(os)) return APT_RUN_SCRIPT;
   else if (OperatingSystemPredicates.supportsYum().apply(os)) return YUM_RUN_SCRIPT;
   else if (OperatingSystemPredicates.supportsZypper().apply(os)) return ZYPPER_RUN_SCRIPT;
   else throw new IllegalArgumentException("don't know how to handle" + os.toString());
 }