modules/jdk.packager/src/main/java/com/oracle/tools/packager/BasicBundlers.java

Print this page




  41 import java.util.Collection;
  42 import java.util.Collections;
  43 import java.util.ServiceLoader;
  44 import java.util.concurrent.CopyOnWriteArrayList;
  45 
  46 /**
  47  * A basic bundlers collection that loads the OpenJFX default bundlers.
  48  * Loads the bundlers common to OpenJFX.
  49  * <UL>
  50  *     <LI>Windows file image</LI>
  51  *     <LI>Mac .app</LI>
  52  *     <LI>Linux file image</LI>
  53  *     <LI>Windows MSI</LI>
  54  *     <LI>Windows EXE</LI>
  55  *     <LI>Mac DMG</LI>
  56  *     <LI>Mac PKG</LI>
  57  *     <LI>Linux DEB</LI>
  58  *     <LI>Linux RPM</LI>
  59  *
  60  * </UL>


  61  */

  62 public class BasicBundlers implements Bundlers {
  63 
  64     boolean defaultsLoaded = false;
  65 
  66     private Collection<Bundler> bundlers = new CopyOnWriteArrayList<>();
  67 
  68     public Collection<Bundler> getBundlers() {
  69         return Collections.unmodifiableCollection(bundlers);
  70     }
  71 
  72     public Collection<Bundler> getBundlers(String type) {
  73         if (type == null) return Collections.emptySet();
  74         switch (type) {
  75             case "NONE":
  76                 return Collections.emptySet();
  77             case "ALL":
  78                 return getBundlers();
  79             default:
  80                 return Arrays.asList(getBundlers().stream()
  81                         .filter(b -> type.equalsIgnoreCase(b.getBundleType()))




  41 import java.util.Collection;
  42 import java.util.Collections;
  43 import java.util.ServiceLoader;
  44 import java.util.concurrent.CopyOnWriteArrayList;
  45 
  46 /**
  47  * A basic bundlers collection that loads the OpenJFX default bundlers.
  48  * Loads the bundlers common to OpenJFX.
  49  * <UL>
  50  *     <LI>Windows file image</LI>
  51  *     <LI>Mac .app</LI>
  52  *     <LI>Linux file image</LI>
  53  *     <LI>Windows MSI</LI>
  54  *     <LI>Windows EXE</LI>
  55  *     <LI>Mac DMG</LI>
  56  *     <LI>Mac PKG</LI>
  57  *     <LI>Linux DEB</LI>
  58  *     <LI>Linux RPM</LI>
  59  *
  60  * </UL>
  61  * 
  62  * @deprecated use {@link ToolProvider} to locate the {@code "javapackager"} tool instead.
  63  */
  64 @Deprecated(since="10", forRemoval=true)
  65 public class BasicBundlers implements Bundlers {
  66 
  67     boolean defaultsLoaded = false;
  68 
  69     private Collection<Bundler> bundlers = new CopyOnWriteArrayList<>();
  70 
  71     public Collection<Bundler> getBundlers() {
  72         return Collections.unmodifiableCollection(bundlers);
  73     }
  74 
  75     public Collection<Bundler> getBundlers(String type) {
  76         if (type == null) return Collections.emptySet();
  77         switch (type) {
  78             case "NONE":
  79                 return Collections.emptySet();
  80             case "ALL":
  81                 return getBundlers();
  82             default:
  83                 return Arrays.asList(getBundlers().stream()
  84                         .filter(b -> type.equalsIgnoreCase(b.getBundleType()))