Class FileEntry
- java.lang.Object
-
- org.junit.platform.engine.reporting.FileEntry
-
@API(status=MAINTAINED, since="1.13.3") public final class FileEntry extends java.lang.ObjectFileEntryencapsulates a file or directory to be published to the reporting infrastructure.- Since:
- 1.12
- See Also:
from(Path, String)
-
-
Constructor Summary
Constructors Modifier Constructor Description privateFileEntry(java.nio.file.Path path, java.lang.String mediaType)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FileEntryfrom(java.nio.file.Path path, java.lang.String mediaType)Factory for creating a newFileEntryfrom the supplied path and media type.java.util.Optional<java.lang.String>getMediaType()Get the media type of the path to be published.java.nio.file.PathgetPath()Get the path for the file or directory to be published.java.time.LocalDateTimegetTimestamp()Get the timestamp for when thisFileEntrywas created.java.lang.StringtoString()
-
-
-
Method Detail
-
from
public static FileEntry from(java.nio.file.Path path, java.lang.String mediaType)
Factory for creating a newFileEntryfrom the supplied path and media type.The
Pathmay represent a file or a directory.- Parameters:
path- the path to publish; nevernullmediaType- the media type of the path to publish; may benull— for example, if the path represents a directory
-
getTimestamp
public java.time.LocalDateTime getTimestamp()
Get the timestamp for when thisFileEntrywas created.- Returns:
- when this entry was created; never
null
-
getPath
public java.nio.file.Path getPath()
Get the path for the file or directory to be published.- Returns:
- the path to publish; never
null
-
getMediaType
public java.util.Optional<java.lang.String> getMediaType()
Get the media type of the path to be published.- Returns:
- the media type of the path to publish; never
nullbut potentially empty — for example, if the path represents a directory
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-