APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.jfr.internal.jfc

public final Class JFC

extends Object
Class Inheritance
Imports
java.io.FileNotFoundException, .IOException, .InputStream, .Reader, .StringReader, java.nio.charset.StandardCharsets, java.nio.file.AccessDeniedException, .Files, .NoSuchFileException, .Path, .Paths, java.text.ParseException, java.util.ArrayList, .Arrays, .List, jdk.jfr.Configuration, jdk.jfr.internal.jfc.model.JFCModelException, jdk.jfr.internal.LogLevel, .LogTag, .Logger, jdk.jfr.internal.util.Utils

Configuration factory for JFC files. *

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
JFC.KnownConfiguration

Reads a known configuration file (located into a string, but doesn't parse it until it's being used.

Field Summary

Modifier and TypeField and Description
private static final int
private static final Path
private static volatile List<JFC.KnownConfiguration>
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
private
JFC()

Method Summary

Modifier and TypeMethod and Description
public static Configuration

Returns:

Configuration, not null
create
(String name, Reader reader)

Reads a configuration from a file.

public static Configuration
private static String
public static String
public static List<Configuration>

Returns:

list of configurations, not null
getConfigurations
()

Returns list of predefined configurations available.

private static List<JFC.KnownConfiguration>
public static List<Path>
public static Configuration
public static String
public static Reader
private static String
public static Path

Returns:

a path, not null
ofPath
(String
textual representation of the path
path
)

Create a path to a .jfc file.

private static byte[]
read(InputStream source, int initialSize)

private static String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

BUFFER_SIZEback to summary
private static final int BUFFER_SIZE
JFC_DIRECTORYback to summary
private static final Path JFC_DIRECTORY
knownConfigurationsback to summary
private static volatile List<JFC.KnownConfiguration> knownConfigurations
MAX_BUFFER_SIZEback to summary
private static final int MAX_BUFFER_SIZE
MAXIMUM_FILE_SIZEback to summary
private static final int MAXIMUM_FILE_SIZE

Constructor Detail

JFCback to summary
private JFC()

Method Detail

createback to summary
public static Configuration create(String name, Reader reader) throws IOException, ParseException

Reads a configuration from a file.

Returns:Configuration

Configuration, not null

Exceptions
IOException:
if the file can't be read
ParseException:
if the file can't be parsed
See Also
java.io.File#getPath()
createKnownback to summary
public static Configuration createKnown(String name) throws IOException, ParseException
exceptionToVerbback to summary
private static String exceptionToVerb(Exception e)
formatExceptionback to summary
public static String formatException(String prefix, Exception e, String input)
getConfigurationsback to summary
public static List<Configuration> getConfigurations()

Returns list of predefined configurations available.

Returns:List<Configuration>

list of configurations, not null

getKnownConfigurationsback to summary
private static List<JFC.KnownConfiguration> getKnownConfigurations()
getPredefinedback to summary
public static List<Path> getPredefined()
getPredefinedback to summary
public static Configuration getPredefined(String name) throws IOException, ParseException
nameFromPathback to summary
public static String nameFromPath(Path file) throws IOException
newReaderback to summary
public static Reader newReader(Path sf) throws IOException
nullSafeFileNameback to summary
private static String nullSafeFileName(Path file) throws IOException
ofPathback to summary
public static Path ofPath(String path)

Create a path to a .jfc file.

If the name is predefined name, i.e. "default" or "profile.jfc", it will return the path for the predefined path in the JDK.

Parameters
path:String

textual representation of the path

Returns:Path

a path, not null

readback to summary
private static byte[] read(InputStream source, int initialSize) throws IOException
readContentback to summary
private static String readContent(InputStream source) throws IOException
jdk.jfr.internal.jfc back to summary

private final Class JFC.KnownConfiguration

extends Object
Class Inheritance

Reads a known configuration file (located into a string, but doesn't parse it until it's being used.

Field Summary

Modifier and TypeField and Description
private Configuration
private final String
private final String
private final String
private final Path

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Configuration
public String
public boolean
private static String
readContent(Path knownPath)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

configurationback to summary
private Configuration configuration
contentback to summary
private final String content
filenameback to summary
private final String filename
nameback to summary
private final String name
pathback to summary
private final Path path

Constructor Detail

KnownConfigurationback to summary
public KnownConfiguration(Path knownPath) throws IOException

Method Detail

getConfigurationFileback to summary
public Configuration getConfigurationFile() throws IOException, ParseException
getNameback to summary
public String getName()
isNamedback to summary
public boolean isNamed(String name)
readContentback to summary
private static String readContent(Path knownPath) throws IOException