< prev index next >

src/jdk.jpackage/linux/classes/jdk/jpackage/internal/LinuxDebBundler.java

Print this page

        

@@ -216,20 +216,20 @@
         }
         return true;
     }
 
     @Override
-    public boolean validate(Map<String, ? super Object> p)
+    public boolean validate(Map<String, ? super Object> params)
             throws UnsupportedPlatformException, ConfigException {
         try {
-            if (p == null) throw new ConfigException(
+            if (params == null) throw new ConfigException(
                     I18N.getString("error.parameters-null"),
                     I18N.getString("error.parameters-null.advice"));
 
             //run basic validation to ensure requirements are met
             //we are not interested in return code, only possible exception
-            APP_BUNDLER.fetchFrom(p).validate(p);
+            APP_BUNDLER.fetchFrom(params).validate(params);
 
             // NOTE: Can we validate that the required tools are available
             // before we start?
             if (!testTool(TOOL_DPKG, "1")){
                 throw new ConfigException(MessageFormat.format(

@@ -237,18 +237,18 @@
                         I18N.getString("error.tool-not-found.advice"));
             }
 
 
             // Show warning is license file is missing
-            String licenseFile = LICENSE_FILE.fetchFrom(p);
+            String licenseFile = LICENSE_FILE.fetchFrom(params);
             if (licenseFile == null) {
                 Log.verbose(I18N.getString("message.debs-like-licenses"));
             }
 
             // only one mime type per association, at least one file extention
             List<Map<String, ? super Object>> associations =
-                    FILE_ASSOCIATIONS.fetchFrom(p);
+                    FILE_ASSOCIATIONS.fetchFrom(params);
             if (associations != null) {
                 for (int i = 0; i < associations.size(); i++) {
                     Map<String, ? super Object> assoc = associations.get(i);
                     List<String> mimes = FA_CONTENT_TYPE.fetchFrom(assoc);
                     if (mimes == null || mimes.isEmpty()) {

@@ -268,11 +268,12 @@
                 }
             }
 
             // bundle name has some restrictions
             // the string converter will throw an exception if invalid
-            BUNDLE_NAME.getStringConverter().apply(BUNDLE_NAME.fetchFrom(p), p);
+            BUNDLE_NAME.getStringConverter().apply(
+                    BUNDLE_NAME.fetchFrom(params), params);
 
             return true;
         } catch (RuntimeException re) {
             if (re.getCause() instanceof ConfigException) {
                 throw (ConfigException) re.getCause();

@@ -280,30 +281,30 @@
                 throw new ConfigException(re);
             }
         }
     }
 
-    private boolean prepareProto(Map<String, ? super Object> p)
+    private boolean prepareProto(Map<String, ? super Object> params)
             throws PackagerException, IOException {
-        File appImage = StandardBundlerParam.getPredefinedAppImage(p);
+        File appImage = StandardBundlerParam.getPredefinedAppImage(params);
         File appDir = null;
 
         // we either have an application image or need to build one
         if (appImage != null) {
-            appDir = new File(APP_IMAGE_ROOT.fetchFrom(p),
-                APP_NAME.fetchFrom(p));
+            appDir = new File(APP_IMAGE_ROOT.fetchFrom(params),
+                APP_NAME.fetchFrom(params));
             // copy everything from appImage dir into appDir/name
             IOUtils.copyRecursive(appImage.toPath(), appDir.toPath());
         } else {
-            appDir = APP_BUNDLER.fetchFrom(p).doBundle(p,
-                    APP_IMAGE_ROOT.fetchFrom(p), true);
+            appDir = APP_BUNDLER.fetchFrom(params).doBundle(params,
+                    APP_IMAGE_ROOT.fetchFrom(params), true);
         }
         return appDir != null;
     }
 
     //@Override
-    public File bundle(Map<String, ? super Object> p,
+    public File bundle(Map<String, ? super Object> params,
             File outdir) throws PackagerException {
         if (!outdir.isDirectory() && !outdir.mkdirs()) {
             throw new PackagerException ("error.cannot-create-output-dir",
                     outdir.getAbsolutePath());
         }

@@ -322,19 +323,19 @@
         //          AppFolder (this is where app image goes)
         //             launcher executable
         //             app
         //             runtime
 
-        File imageDir = DEB_IMAGE_DIR.fetchFrom(p);
-        File configDir = CONFIG_DIR.fetchFrom(p);
+        File imageDir = DEB_IMAGE_DIR.fetchFrom(params);
+        File configDir = CONFIG_DIR.fetchFrom(params);
 
         try {
 
             imageDir.mkdirs();
             configDir.mkdirs();
-            if (prepareProto(p) && prepareProjectConfig(p)) {
-                return buildDeb(p, outdir);
+            if (prepareProto(params) && prepareProjectConfig(params)) {
+                return buildDeb(params, outdir);
             }
             return null;
         } catch (IOException ex) {
             Log.verbose(ex);
             throw new PackagerException(ex);
< prev index next >