Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
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 (309)
Collections:
Other Resources:
JDK 11 jdk.jfr.jmod - JFR Module
JDK 11 jdk.jfr.jmod is the JMOD file for JDK 11 JFR module.
JDK 11 JFR module compiled class files are stored in \fyicenter\jdk-11.0.1\jmods\jdk.jfr.jmod.
JDK 11 JFR module compiled class files are also linked and stored in the \fyicenter\jdk-11.0.1\lib\modules JImage file.
JDK 11 JFR module source code files are stored in \fyicenter\jdk-11.0.1\lib\src.zip\jdk.jfr.
You can click and view the content of each source code file in the list below.
✍: FYIcenter
⏎ jdk/jfr/internal/WriteableUserPath.java
/* * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * * * * * * * * * * * * * * * * * * * * */ package jdk.jfr.internal; import java.io.BufferedWriter; import java.io.FileNotFoundException; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.security.AccessControlContext; import java.security.AccessController; import java.security.PrivilegedExceptionAction; import java.util.concurrent.Callable; /** * Purpose of this class is to simplify analysis of security risks. * <p> * Paths in the public API should be wrapped in this class so we * at all time know what kind of paths we are dealing with. * <p> * A user supplied path must never be used in an unsafe context, such as a * shutdown hook or any other thread created by JFR. * <p> * All operation using this path must happen in {@link #doPriviligedIO(Callable)} */ public final class WriteableUserPath { private final AccessControlContext controlContext; private final Path original; private final Path real; private final String text; // Not to ensure security, but to help // against programming errors private volatile boolean inPrivileged; public WriteableUserPath(Path path) throws IOException { controlContext = AccessController.getContext(); // verify that the path is writeable if (Files.exists(path) && !Files.isWritable(path)) { // throw same type of exception as FileOutputStream // constructor, if file can't be opened. throw new FileNotFoundException("Could not write to file: " + path.toAbsolutePath()); } // will throw if non-writeable BufferedWriter fw = Files.newBufferedWriter(path); fw.close(); this.original = path; this.real = path.toRealPath(); this.text = real.toString(); } /** * Returns a potentially malicious path where the user may have implemented * their own version of Path. This method should never be called in an * unsafe context and the Path value should never be passed along to other * methods. * * @return path from a potentially malicious user */ public Path getPotentiallyMaliciousOriginal() { return original; } /** * Returns a string representation of the path. * * @return path as text */ public String getText() { return text; } /** * Returns a potentially malicious path where the user may have implemented * their own version of Path. This method should never be called in an * unsafe context and the Path value should never be passed along to other * methods. * * @return path from a potentially malicious user */ public Path getReal() { if (!inPrivileged) { throw new InternalError("A user path was accessed outside the context it was supplied in"); } return real; } public void doPriviligedIO(Callable<?> function) throws IOException { try { inPrivileged = true; AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() { @Override public Void run() throws Exception { function.call(); return null; } }, controlContext); } catch (Throwable t) { // prevent malicious user to propagate exception callback // in the wrong context throw new IOException("Unexpected error during I/O operation"); } finally { inPrivileged = false; } } }
⏎ jdk/jfr/internal/WriteableUserPath.java
Or download all of them as a single archive file:
File name: jdk.jfr-11.0.1-src.zip File size: 237632 bytes Release date: 2018-11-04 Download
⇒ JDK 11 jdk.jlink.jmod - JLink Tool
2020-06-30, 37775👍, 0💬
Popular Posts:
What Is in Xerces-J-bin.2.12.2.zip? Xerces-J-bin.2.12.2.zip file is the distribution package ZIP fil...
JDK 11 jdk.internal.JVM Stat.jmod is the JMOD file for JDK 11 Internal Jvmstat module. JDK 11 Intern...
JDK 11 java.sql.rowset.jmod is the JMOD file for JDK 11 SQL Rowset module. JDK 11 SQL Rowset module ...
If you are a Java developer, it is very often that you need to use some 3rd party libraries to perfo...
The Bouncy Castle Crypto package is a Java implementation of cryptographic algorithms, it was develo...