1 /*
   2  * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.sun.javafx.tools.packager.bundlers;
  27 
  28 /**
  29  * @deprecated use {@link ToolProvider} to locate the {@code "javapackager"} tool instead.
  30  */
  31 @Deprecated(since="10", forRemoval=true)
  32 public final class Bundler {
  33 
  34     private Bundler() {}
  35 
  36     /**
  37      * Located here for backwards compatibility
  38      */
  39     @Deprecated
  40     public enum BundleType {
  41         NONE,
  42         @Deprecated
  43         ALL,      // Generates all bundlers
  44         JNLP,     // Generates JNLP
  45         NATIVE,   // Generates both app image and all installers
  46         IMAGE,    // Generates app image only
  47         INSTALLER // Generates installers
  48     }
  49 
  50     @Deprecated
  51     public static final class Bundle {
  52         public BundleType type = BundleType.NONE;
  53         public String format = null;
  54     }
  55 
  56     @Deprecated
  57     static public Bundle stringToBundle(String value) {
  58         Bundle result = new Bundle();
  59 
  60         if (!value.isEmpty()) {
  61             if ("false".equals(value) || "none".equals(value)) {
  62                 result.type = BundleType.NONE;
  63             } else if ("all".equals(value) || "true".equals(value)) {
  64                 result.type = BundleType.ALL;
  65             } else if ("jnlp".equals(value)) {
  66                 result.type = BundleType.JNLP;
  67             } else if ("image".equals(value)) {
  68                 result.type = BundleType.IMAGE;
  69             } else if ("native".equals(value)) {
  70                 result.type = BundleType.NATIVE;
  71             } else if ("installer".equals(value)) {
  72                 result.type = BundleType.INSTALLER;
  73             } else {
  74                 //assume it is request to build only specific format (like exe or msi)
  75                 result.type = BundleType.INSTALLER;
  76                 result.format = (value != null) ? value.toLowerCase() : null;
  77             }
  78         }
  79 
  80         return result;
  81     }
  82 }