Class FileEntry


  • @API(status=MAINTAINED,
         since="1.13.3")
    public final class FileEntry
    extends java.lang.Object
    FileEntry encapsulates a file or directory to be published to the reporting infrastructure.
    Since:
    1.12
    See Also:
    from(Path, String)
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static FileEntry from​(java.nio.file.Path path, java.lang.String mediaType)
      Factory for creating a new FileEntry from 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.Path getPath()
      Get the path for the file or directory to be published.
      java.time.LocalDateTime getTimestamp()
      Get the timestamp for when this FileEntry was created.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Method Detail

      • from

        public static FileEntry from​(java.nio.file.Path path,
                                     java.lang.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 - the path to publish; never null
        mediaType - the media type of the path to publish; may be null — for example, if the path represents a directory
      • getTimestamp

        public java.time.LocalDateTime getTimestamp()
        Get the timestamp for when this FileEntry was 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 null but potentially empty — for example, if the path represents a directory
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object