Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (102)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (322)
Collections:
Other Resources:
JDK 17 jdk.jpackage.jmod - JPackage Tool
JDK 17 jdk.jpackage.jmod is the JMOD file for JDK 17 JPackage tool,
which can be invoked by the "jpackage" command.
JDK 17 JPackage tool compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.jpackage.jmod.
JDK 17 JPackage tool compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 JPackage tool source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.jpackage.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/jpackage/internal/AppImageBundler.java
/*
* Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package jdk.jpackage.internal;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.text.MessageFormat;
import java.util.Map;
import java.util.Objects;
import java.util.function.Function;
import static jdk.jpackage.internal.StandardBundlerParam.PREDEFINED_APP_IMAGE;
import static jdk.jpackage.internal.StandardBundlerParam.PREDEFINED_RUNTIME_IMAGE;
import static jdk.jpackage.internal.StandardBundlerParam.LAUNCHER_DATA;
import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME;
class AppImageBundler extends AbstractBundler {
@Override
public final String getName() {
return I18N.getString("app.bundler.name");
}
@Override
public final String getID() {
return "app";
}
@Override
public final String getBundleType() {
return "IMAGE";
}
@Override
public final boolean validate(Map<String, ? super Object> params)
throws ConfigException {
try {
Objects.requireNonNull(params);
if (!params.containsKey(PREDEFINED_APP_IMAGE.getID())
&& !StandardBundlerParam.isRuntimeInstaller(params)) {
LAUNCHER_DATA.fetchFrom(params);
}
if (paramsValidator != null) {
paramsValidator.validate(params);
}
} catch (RuntimeException re) {
if (re.getCause() instanceof ConfigException) {
throw (ConfigException) re.getCause();
} else {
throw new ConfigException(re);
}
}
return true;
}
@Override
public final Path execute(Map<String, ? super Object> params,
Path outputParentDir) throws PackagerException {
if (StandardBundlerParam.isRuntimeInstaller(params)) {
return PREDEFINED_RUNTIME_IMAGE.fetchFrom(params);
}
try {
return createAppBundle(params, outputParentDir);
} catch (PackagerException pe) {
throw pe;
} catch (RuntimeException|IOException|ConfigException ex) {
Log.verbose(ex);
throw new PackagerException(ex);
}
}
@Override
public final boolean supported(boolean runtimeInstaller) {
return true;
}
@Override
public final boolean isDefault() {
return false;
}
final AppImageBundler setDependentTask(boolean v) {
dependentTask = v;
return this;
}
final AppImageBundler setAppImageSupplier(
Function<Path, AbstractAppImageBuilder> v) {
appImageSupplier = v;
return this;
}
final AppImageBundler setParamsValidator(ParamsValidator v) {
paramsValidator = v;
return this;
}
@FunctionalInterface
interface ParamsValidator {
void validate(Map<String, ? super Object> params) throws ConfigException;
}
private Path createRoot(Map<String, ? super Object> params,
Path outputDirectory) throws PackagerException, IOException {
IOUtils.writableOutputDir(outputDirectory);
String imageName = APP_NAME.fetchFrom(params);
if (Platform.isMac()) {
imageName = imageName + ".app";
}
if (!dependentTask) {
Log.verbose(MessageFormat.format(
I18N.getString("message.creating-app-bundle"),
imageName, outputDirectory.toAbsolutePath()));
}
// Create directory structure
Path rootDirectory = outputDirectory.resolve(imageName);
if (Files.exists(rootDirectory)) {
throw new PackagerException("error.root-exists",
rootDirectory.toAbsolutePath().toString());
}
Files.createDirectories(rootDirectory);
return rootDirectory;
}
private Path createAppBundle(Map<String, ? super Object> params,
Path outputDirectory) throws PackagerException, IOException,
ConfigException {
Path rootDirectory = createRoot(params, outputDirectory);
AbstractAppImageBuilder appBuilder = appImageSupplier.apply(rootDirectory);
if (PREDEFINED_RUNTIME_IMAGE.fetchFrom(params) == null ) {
JLinkBundlerHelper.execute(params,
appBuilder.getAppLayout().runtimeHomeDirectory());
} else {
StandardBundlerParam.copyPredefinedRuntimeImage(
params, appBuilder.getAppLayout());
}
appBuilder.prepareApplicationFiles(params);
return rootDirectory;
}
private boolean dependentTask;
private ParamsValidator paramsValidator;
private Function<Path, AbstractAppImageBuilder> appImageSupplier;
}
⏎ jdk/jpackage/internal/AppImageBundler.java
Or download all of them as a single archive file:
File name: jdk.jpackage-17.0.5-src.zip File size: 92069 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.jshell.jmod - JShell Tool
2023-08-03, ≈13🔥, 0💬
Popular Posts:
How to merge two JAR files with "jar" commands? I am tired of specifying multiple JAR files in the c...
How to perform XML Schema validation with sax\Writer.java provided in the Apache Xerces package? You...
maven-compat-3.8.6.jar is the JAR file for Apache Maven 3.8.6 Compact module. The JAR file name may ...
How to display types defined in an XML Schema file with the xs\QueryXS.java provided in the Apache X...
How to download and install JDK (Java Development Kit) 5? If you want to write Java applications, yo...