< prev index next >

src/jdk.incubator.jpackage/share/classes/jdk/incubator/jpackage/internal/AbstractBundler.java

Print this page

        

@@ -21,13 +21,44 @@
  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 
-package jdk.jpackage.internal;
+package jdk.incubator.jpackage.internal;
 
-public class InvalidBundlerParamException extends RuntimeException {
-    private static final long serialVersionUID = 1L;
-    public InvalidBundlerParamException(String message) {
-        super(message);
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+
+
+/**
+ * AbstractBundler
+ *
+ * This is the base class all bundlers extend from.
+ * It contains methods and parameters common to all bundlers.
+ * The concrete implementations are in the platform specific bundlers.
+ */
+abstract class AbstractBundler implements Bundler {
+
+    static final BundlerParamInfo<File> IMAGES_ROOT =
+            new StandardBundlerParam<>(
+            "imagesRoot",
+            File.class,
+            params -> new File(
+                StandardBundlerParam.TEMP_ROOT.fetchFrom(params), "images"),
+            (s, p) -> null);
+
+    @Override
+    public String toString() {
+        return getName();
+    }
+
+    @Override
+    public void cleanup(Map<String, ? super Object> params) {
+        try {
+            IOUtils.deleteRecursive(
+                    StandardBundlerParam.TEMP_ROOT.fetchFrom(params));
+        } catch (IOException e) {
+            Log.verbose(e.getMessage());
+        }
     }
 }
< prev index next >