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.internal.le.jmod - Internal Line Editing Module
JDK 17 jdk.internal.le.jmod is the JMOD file for JDK 17 Internal Line Editing module.
JDK 17 Internal Line Editing module compiled class files are stored in \fyicenter\jdk-17.0.5\jmods\jdk.internal.le.jmod.
JDK 17 Internal Line Editing module compiled class files are also linked and stored in the \fyicenter\jdk-17.0.5\lib\modules JImage file.
JDK 17 Internal Line Editing module source code files are stored in \fyicenter\jdk-17.0.5\lib\src.zip\jdk.internal.le.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/internal/org/jline/utils/ExecHelper.java
/*
* Copyright (c) 2002-2016, the original author or authors.
*
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* https://opensource.org/licenses/BSD-3-Clause
*/
package jdk.internal.org.jline.utils;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InterruptedIOException;
import java.io.OutputStream;
import java.util.Map;
import java.util.Objects;
/**
* Helper methods for running unix commands.
*/
public final class ExecHelper {
private ExecHelper() {
}
public static String exec(boolean redirectInput, final String... cmd) throws IOException {
Objects.requireNonNull(cmd);
try {
Log.trace("Running: ", cmd);
ProcessBuilder pb = new ProcessBuilder(cmd);
if (OSUtils.IS_AIX) {
Map<String,String> env = pb.environment();
env.put("PATH", "/opt/freeware/bin:" + env.get("PATH"));
env.put("LANG", "C");
env.put("LC_ALL", "C");
}
if (redirectInput) {
pb.redirectInput(ProcessBuilder.Redirect.INHERIT);
}
Process p = pb.start();
String result = waitAndCapture(p);
Log.trace("Result: ", result);
if (p.exitValue() != 0) {
if (result.endsWith("\n")) {
result = result.substring(0, result.length() - 1);
}
throw new IOException("Error executing '" + String.join(" ", (CharSequence[]) cmd) + "': " + result);
}
return result;
} catch (InterruptedException e) {
throw (IOException) new InterruptedIOException("Command interrupted").initCause(e);
}
}
public static String waitAndCapture(Process p) throws IOException, InterruptedException {
ByteArrayOutputStream bout = new ByteArrayOutputStream();
InputStream in = null;
InputStream err = null;
OutputStream out = null;
try {
int c;
in = p.getInputStream();
while ((c = in.read()) != -1) {
bout.write(c);
}
err = p.getErrorStream();
while ((c = err.read()) != -1) {
bout.write(c);
}
out = p.getOutputStream();
p.waitFor();
} finally {
close(in, out, err);
}
return bout.toString();
}
private static void close(final Closeable... closeables) {
for (Closeable c : closeables) {
if (c != null) {
try {
c.close();
} catch (Exception e) {
// Ignore
}
}
}
}
}
⏎ jdk/internal/org/jline/utils/ExecHelper.java
Or download all of them as a single archive file:
File name: jdk.internal.le-17.0.5-src.zip File size: 231458 bytes Release date: 2022-09-13 Download
⇒ JDK 17 jdk.internal.opt.jmod - Internal Opt Module
⇐ JDK 17 jdk.internal.jvmstat.jmod - Internal JVM Stat Module
2023-08-25, ≈26🔥, 0💬
Popular Posts:
JUnit Source Code Files are provided in the source package file, junit-4.13.2-sources.jar .You can b...
pache Derby is an open source relational database implemented entirely in Java and available under t...
JDK 11 jdk.rmic.jmod is the JMOD file for JDK 11 RMI (Remote Method Invocation) Compiler Tool tool, ...
JDK 17 jdk.hotspot.agent.jmod is the JMOD file for JDK 17 Hotspot Agent module. JDK 17 Hotspot Agent...
How to perform XML Schema validation with sax\Writer.java provided in the Apache Xerces package? You...