Java Code Examples for jdk.jfr.internal.jfc.JFC#create()
The following examples show how to use
jdk.jfr.internal.jfc.JFC#create() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Configuration.java From dragonwell8_jdk with GNU General Public License v2.0 | 3 votes |
/** * Reads a configuration from a file. * * @param path the file that contains the configuration, not {@code null} * @return the read {@link Configuration}, not {@code null} * @throws ParseException if the file can't be parsed * @throws IOException if the file can't be read * @throws SecurityException if a security manager exists and its * {@code checkRead} method denies read access to the file. * * @see java.io.File#getPath() * @see java.lang.SecurityManager#checkRead(java.lang.String) */ public static Configuration create(Path path) throws IOException, ParseException { Objects.requireNonNull(path); JVMSupport.ensureWithIOException(); try (Reader reader = Files.newBufferedReader(path)) { return JFC.create(JFC.nameFromPath(path), reader); } }
Example 2
Source File: Configuration.java From TencentKona-8 with GNU General Public License v2.0 | 3 votes |
/** * Reads a configuration from a file. * * @param path the file that contains the configuration, not {@code null} * @return the read {@link Configuration}, not {@code null} * @throws ParseException if the file can't be parsed * @throws IOException if the file can't be read * @throws SecurityException if a security manager exists and its * {@code checkRead} method denies read access to the file. * * @see java.io.File#getPath() * @see java.lang.SecurityManager#checkRead(java.lang.String) */ public static Configuration create(Path path) throws IOException, ParseException { Objects.requireNonNull(path); JVMSupport.ensureWithIOException(); try (Reader reader = Files.newBufferedReader(path)) { return JFC.create(JFC.nameFromPath(path), reader); } }
Example 3
Source File: Configuration.java From openjdk-jdk8u with GNU General Public License v2.0 | 3 votes |
/** * Reads a configuration from a file. * * @param path the file that contains the configuration, not {@code null} * @return the read {@link Configuration}, not {@code null} * @throws ParseException if the file can't be parsed * @throws IOException if the file can't be read * @throws SecurityException if a security manager exists and its * {@code checkRead} method denies read access to the file. * * @see java.io.File#getPath() * @see java.lang.SecurityManager#checkRead(java.lang.String) */ public static Configuration create(Path path) throws IOException, ParseException { Objects.requireNonNull(path); JVMSupport.ensureWithIOException(); try (Reader reader = Files.newBufferedReader(path)) { return JFC.create(JFC.nameFromPath(path), reader); } }
Example 4
Source File: Configuration.java From dragonwell8_jdk with GNU General Public License v2.0 | 2 votes |
/** * Reads a configuration from a reader. * * @param reader a reader that contains the configuration contents, not * {@code null} * @return a configuration, not {@code null} * @throws IOException if an I/O error occurs while trying to read contents * from the reader * @throws ParseException if the file can't be parsed */ public static Configuration create(Reader reader) throws IOException, ParseException { Objects.requireNonNull(reader); JVMSupport.ensureWithIOException(); return JFC.create(null, reader); }
Example 5
Source File: Configuration.java From TencentKona-8 with GNU General Public License v2.0 | 2 votes |
/** * Reads a configuration from a character stream. * * @param reader a {@code Reader} that provides the configuration contents, not * {@code null} * @return a configuration, not {@code null} * @throws IOException if an I/O error occurs while trying to read contents * from the {@code Reader} * @throws ParseException if the file can't be parsed */ public static Configuration create(Reader reader) throws IOException, ParseException { Objects.requireNonNull(reader); JVMSupport.ensureWithIOException(); return JFC.create(null, reader); }
Example 6
Source File: Configuration.java From openjdk-jdk8u with GNU General Public License v2.0 | 2 votes |
/** * Reads a configuration from a character stream. * * @param reader a {@code Reader} that provides the configuration contents, not * {@code null} * @return a configuration, not {@code null} * @throws IOException if an I/O error occurs while trying to read contents * from the {@code Reader} * @throws ParseException if the file can't be parsed */ public static Configuration create(Reader reader) throws IOException, ParseException { Objects.requireNonNull(reader); JVMSupport.ensureWithIOException(); return JFC.create(null, reader); }