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

Print this page




  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.oracle.tools.packager;
  27 
  28 import com.oracle.tools.packager.windows.WindowsBundlerParam;
  29 
  30 import java.io.ByteArrayOutputStream;
  31 import java.io.File;
  32 import java.io.FileInputStream;
  33 import java.io.FileNotFoundException;
  34 import java.io.IOException;
  35 import java.io.InputStream;
  36 import java.nio.file.Files;
  37 import java.text.MessageFormat;
  38 import java.util.*;
  39 import com.oracle.tools.packager.IOUtils;
  40 




  41 public abstract class AbstractBundler implements Bundler {
  42 
  43     private static final ResourceBundle I18N =
  44             ResourceBundle.getBundle(AbstractBundler.class.getName());
  45 
  46     public static final BundlerParamInfo<File> IMAGES_ROOT = new WindowsBundlerParam<>(
  47             I18N.getString("param.images-root.name"),
  48             I18N.getString("param.images-root.description"),
  49             "imagesRoot",
  50             File.class,
  51             params -> new File(StandardBundlerParam.BUILD_ROOT.fetchFrom(params), "images"),
  52             (s, p) -> null);
  53 
  54     //do not use file separator -
  55     // we use it for classpath lookup and there / are not platform specific
  56     public final static String BUNDLER_PREFIX = "package/";
  57 
  58     protected Class baseResourceLoader = null;
  59 
  60     protected void fetchResource(




  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.oracle.tools.packager;
  27 
  28 import com.oracle.tools.packager.windows.WindowsBundlerParam;
  29 
  30 import java.io.ByteArrayOutputStream;
  31 import java.io.File;
  32 import java.io.FileInputStream;
  33 import java.io.FileNotFoundException;
  34 import java.io.IOException;
  35 import java.io.InputStream;
  36 import java.nio.file.Files;
  37 import java.text.MessageFormat;
  38 import java.util.*;
  39 import com.oracle.tools.packager.IOUtils;
  40 
  41 /**
  42  * @deprecated use {@link ToolProvider} to locate the {@code "javapackager"} tool instead.
  43  */
  44 @Deprecated(since="10", forRemoval=true)
  45 public abstract class AbstractBundler implements Bundler {
  46 
  47     private static final ResourceBundle I18N =
  48             ResourceBundle.getBundle(AbstractBundler.class.getName());
  49 
  50     public static final BundlerParamInfo<File> IMAGES_ROOT = new WindowsBundlerParam<>(
  51             I18N.getString("param.images-root.name"),
  52             I18N.getString("param.images-root.description"),
  53             "imagesRoot",
  54             File.class,
  55             params -> new File(StandardBundlerParam.BUILD_ROOT.fetchFrom(params), "images"),
  56             (s, p) -> null);
  57 
  58     //do not use file separator -
  59     // we use it for classpath lookup and there / are not platform specific
  60     public final static String BUNDLER_PREFIX = "package/";
  61 
  62     protected Class baseResourceLoader = null;
  63 
  64     protected void fetchResource(