Class FileEntity

java.lang.Object
it.tidalwave.ui.example.model.FileEntity
All Implemented Interfaces:
Displayable, it.tidalwave.util.As

@Immutable public class FileEntity extends Object implements it.tidalwave.util.As, Displayable
A class that models a file with its attributes and children.
Author:
Fabrizio Giudici
  • Method Details

    • of

      @Nonnull public static FileEntity of(@Nonnull Path path)
      Returns a new instance. related to the given path.
      Parameters:
      path - the path
      Returns:
      a new instance
    • getDisplayName

      @Nonnull public String getDisplayName()
      Returns the display name.. It's a static implementation of the Displayable role.
      Specified by:
      getDisplayName in interface Displayable
      Returns:
      the display name
    • getCreationDateTime

      @Nonnull public ZonedDateTime getCreationDateTime() throws IOException
      Returns the creation date-time. of the file.
      Returns:
      the creation date-time
      Throws:
      IOException - if the file does not exist or cannot be accessed
    • getLastAccessDateTime

      @Nonnull public ZonedDateTime getLastAccessDateTime() throws IOException
      Returns the last access date-time. of the file.
      Returns:
      the last access date-time
      Throws:
      IOException - if the file does not exist or cannot be accessed
    • getLastModifiedDateTime

      @Nonnull public ZonedDateTime getLastModifiedDateTime() throws IOException
      Returns the last modified date-time. of the file.
      Returns:
      the last modified date-time
      Throws:
      IOException - if the file does not exist or cannot be accessed
    • getSize

      @Nonnegative public long getSize() throws IOException
      Returns the size. of the file.
      Returns:
      the size
      Throws:
      IOException - if the file does not exist or cannot be accessed