< prev index next >
src/jdk.jpackage/share/classes/jdk/jpackage/internal/DeployParams.java
Print this page
@@ -50,35 +50,24 @@
*/
public class DeployParams {
final List<RelativeFileSet> resources = new ArrayList<>();
- String id;
- String vendor;
- String email;
- String description;
+ BundlerType bundleType = BundlerType.NONE;
+ String targetFormat = null; //means any
String licenseType;
String copyright;
String version;
- Boolean systemWide;
- Boolean serviceHint;
- Boolean signBundle;
- Boolean installdirChooser;
-
String applicationClass;
- List<Param> params;
-
// Java modules support
String addModules = null;
String limitModules = null;
- String modulePath = null;
String module = null;
File outdir = null;
- String appId = null;
// list of jvm args
// (in theory string can contain spaces and need to be escaped
List<String> jvmargs = new LinkedList<>();
@@ -95,22 +84,10 @@
void setVersion(String version) {
this.version = version;
}
- void setSystemWide(Boolean systemWide) {
- this.systemWide = systemWide;
- }
-
- void setInstalldirChooser(Boolean installdirChooser) {
- this.installdirChooser = installdirChooser;
- }
-
- void setSignBundle(Boolean signBundle) {
- this.signBundle = signBundle;
- }
-
void addJvmArg(String v) {
jvmargs.add(v);
}
void addAddModule(String value) {
@@ -129,42 +106,14 @@
else {
limitModules += "," + value;
}
}
- String getModulePath() {
- return this.modulePath;
- }
-
- void setModulePath(String value) {
- this.modulePath = value;
- }
-
void setModule(String value) {
this.module = value;
}
- void setDescription(String description) {
- this.description = description;
- }
-
- public void setAppId(String id) {
- appId = id;
- }
-
- void setParams(List<Param> params) {
- this.params = params;
- }
-
- void setVendor(String vendor) {
- this.vendor = vendor;
- }
-
- void setEmail(String email) {
- this.email = email;
- }
-
void setApplicationClass(String applicationClass) {
this.applicationClass = applicationClass;
}
File getOutput() {
@@ -235,17 +184,10 @@
}
addBundleArgument(
StandardBundlerParam.CLASSPATH.getID(), classpath);
}
- private static File createFile(final File baseDir, final String path) {
- final File testFile = new File(path);
- return testFile.isAbsolute() ?
- testFile : new File(baseDir == null ?
- null : baseDir.getAbsolutePath(), path);
- }
-
static void validateName(String s, boolean forApp)
throws PackagerException {
String exceptionKey = forApp ?
"ERR_InvalidAppName" : "ERR_InvalidSLName";
@@ -398,13 +340,10 @@
}
return result;
}
- BundlerType bundleType = BundlerType.NONE;
- String targetFormat = null; //means any
-
void setBundleType(BundlerType type) {
bundleType = type;
}
BundlerType getBundleType() {
@@ -417,24 +356,11 @@
String getTargetFormat() {
return targetFormat;
}
- private String getArch() {
- String arch = System.getProperty("os.arch").toLowerCase();
-
- if ("x86".equals(arch) || "i386".equals(arch) || "i486".equals(arch)
- || "i586".equals(arch) || "i686".equals(arch)) {
- arch = "x86";
- } else if ("x86_64".equals(arch) || "amd64".equals("arch")) {
- arch = "x86_64";
- }
-
- return arch;
- }
-
- static final Set<String> multi_args = new TreeSet<>(Arrays.asList(
+ private static final Set<String> multi_args = new TreeSet<>(Arrays.asList(
StandardBundlerParam.JAVA_OPTIONS.getID(),
StandardBundlerParam.ARGUMENTS.getID(),
StandardBundlerParam.MODULE_PATH.getID(),
StandardBundlerParam.ADD_MODULES.getID(),
StandardBundlerParam.LIMIT_MODULES.getID(),
@@ -477,15 +403,11 @@
bundleParams.setApplicationClass(applicationClass);
bundleParams.setAppVersion(version);
bundleParams.setType(bundleType);
bundleParams.setBundleFormat(targetFormat);
- bundleParams.setVendor(vendor);
- bundleParams.setEmail(email);
- bundleParams.setInstalldirChooser(installdirChooser);
bundleParams.setCopyright(copyright);
- bundleParams.setDescription(description);
bundleParams.setJvmargs(jvmargs);
if (addModules != null && !addModules.isEmpty()) {
bundleParams.setAddModules(addModules);
@@ -493,25 +415,14 @@
if (limitModules != null && !limitModules.isEmpty()) {
bundleParams.setLimitModules(limitModules);
}
- if (modulePath != null && !modulePath.isEmpty()) {
- bundleParams.setModulePath(modulePath);
- }
-
if (module != null && !module.isEmpty()) {
bundleParams.setMainModule(module);
}
- Map<String, String> paramsMap = new TreeMap<>();
- if (params != null) {
- for (Param p : params) {
- paramsMap.put(p.name, p.value);
- }
- }
-
Map<String, String> unescapedHtmlParams = new TreeMap<>();
Map<String, String> escapedHtmlParams = new TreeMap<>();
// check for collisions
TreeSet<String> keys = new TreeSet<>(bundlerArguments.keySet());
@@ -529,28 +440,10 @@
Map<String, ? super Object> getBundlerArguments() {
return this.bundlerArguments;
}
- void putUnlessNull(String param, Object value) {
- if (value != null) {
- bundlerArguments.put(param, value);
- }
- }
-
- void putUnlessNullOrEmpty(String param, Map<?, ?> value) {
- if (value != null && !value.isEmpty()) {
- bundlerArguments.put(param, value);
- }
- }
-
- void putUnlessNullOrEmpty(String param, Collection<?> value) {
- if (value != null && !value.isEmpty()) {
- bundlerArguments.put(param, value);
- }
- }
-
@Override
public String toString() {
return "DeployParams {" + "output: " + outdir
+ " resources: {" + resources + "}}";
}
< prev index next >