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/ScriptRunner.java
/*
* Copyright (c) 2019, 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.util.Map;
import java.util.Objects;
import java.util.Optional;
import static jdk.jpackage.internal.OverridableResource.createResource;
import static jdk.jpackage.internal.StandardBundlerParam.APP_NAME;
import static jdk.jpackage.internal.StandardBundlerParam.CONFIG_ROOT;
/**
* Runs custom script from resource directory.
*/
class ScriptRunner {
ScriptRunner() {
environment = new ProcessBuilder().environment();
}
ScriptRunner setResourceCategoryId(String v) {
resourceCategoryId = v;
return this;
}
ScriptRunner setDirectory(Path v) {
directory = v;
return this;
}
ScriptRunner setScriptNameSuffix(String v) {
scriptNameSuffix = v;
return this;
}
ScriptRunner addEnvironment(Map<String, String> v) {
environment.putAll(v);
return this;
}
ScriptRunner setEnvironmentVariable(String envVarName, String envVarValue) {
Objects.requireNonNull(envVarName);
if (envVarValue == null) {
environment.remove(envVarName);
} else {
environment.put(envVarName, envVarValue);
}
return this;
}
public void run(Map<String, ? super Object> params) throws IOException {
String scriptName = String.format("%s-%s%s", APP_NAME.fetchFrom(params),
scriptNameSuffix, scriptSuffix());
Path scriptPath = CONFIG_ROOT.fetchFrom(params).resolve(
scriptName);
createResource(null, params)
.setCategory(I18N.getString(resourceCategoryId))
.saveToFile(scriptPath);
if (!Files.exists(scriptPath)) {
return;
}
ProcessBuilder pb = new ProcessBuilder(shell(),
scriptPath.toAbsolutePath().toString());
Map<String, String> workEnvironment = pb.environment();
workEnvironment.clear();
workEnvironment.putAll(environment);
if (directory != null) {
pb.directory(directory.toFile());
}
Executor.of(pb).executeExpectSuccess();
}
private static String shell() {
if (Platform.isWindows()) {
return "cscript";
}
return Optional.ofNullable(System.getenv("SHELL")).orElseGet(() -> "sh");
}
private static String scriptSuffix() {
if (Platform.isWindows()) {
return ".wsf";
}
return ".sh";
}
private String scriptNameSuffix;
private String resourceCategoryId;
private Path directory;
private Map<String, String> environment;
}
⏎ jdk/jpackage/internal/ScriptRunner.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, ≈22🔥, 0💬
Popular Posts:
Apache Commons Lang 3 is the 3rd version of Apache Commons Lang, which provides a host of helper uti...
What Is commons-collections4-4.4 .jar?commons-collections4-4.4 .jaris the JAR file for Apache Common...
What Is junit-3.8.1.jar? junit-3.8.1.jar is the version 3.8.1 of JUnit JAR library file. JUnit is a ...
Jackson is "the Java JSON library" or "the best JSON parser for Java". Or simply as "JSON for Java"....
SLF4J API is a simple API that allows to plug in any desired logging library at deployment time. Her...