Top Description Fields Constructors Methods
org.junit.platform.engine.reporting

public final Class FileEntry

extends Object
Class Inheritance
Annotations
@API
status:MAINTAINED
since:1.13.3
Static Imports
org.apiguardian.api.API.Status.MAINTAINED

FileEntry encapsulates a file or directory to be published to the reporting infrastructure.
Since
1.12
See Also
from(Path, String)

Field Summary

Modifier and TypeField and Description
private final @Nullable String
private final Path
private final LocalDateTime

Constructor Summary

AccessConstructor and Description
private
FileEntry(Path path, @Nullable String mediaType)

Method Summary

Modifier and TypeMethod and Description
public static FileEntry
from(Path
the path to publish; never null
path
,
@Nullable String
the media type of the path to publish; may be null — for example, if the path represents a directory
mediaType
)

Factory for creating a new FileEntry from the supplied path and media type.

public Optional<String>

Returns:

the media type of the path to publish; never null but potentially empty — for example, if the path represents a directory
getMediaType
()

Get the media type of the path to be published.

public Path

Returns:

the path to publish; never null
getPath
()

Get the path for the file or directory to be published.

public LocalDateTime

Returns:

when this entry was created; never null
getTimestamp
()

Get the timestamp for when this FileEntry was created.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

mediaTypeback to summary
private final @Nullable String mediaType
pathback to summary
private final Path path
timestampback to summary
private final LocalDateTime timestamp

Constructor Detail

FileEntryback to summary
private FileEntry(Path path, @Nullable String mediaType)

Method Detail

fromback to summary
public static FileEntry from(Path path, @Nullable String mediaType)

Factory for creating a new FileEntry from the supplied path and media type.

The Path may represent a file or a directory.

Parameters
path:Path

the path to publish; never null

mediaType:@Nullable String

the media type of the path to publish; may be null — for example, if the path represents a directory

getMediaTypeback to summary
public Optional<String> getMediaType()

Get the media type of the path to be published.

Returns:Optional<String>

the media type of the path to publish; never null but potentially empty — for example, if the path represents a directory

getPathback to summary
public Path getPath()

Get the path for the file or directory to be published.

Returns:Path

the path to publish; never null

getTimestampback to summary
public LocalDateTime getTimestamp()

Get the timestamp for when this FileEntry was created.

Returns:LocalDateTime

when this entry was created; never null

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override