Class FileListEntry


  • public final class FileListEntry
    extends java.lang.Object
    Wrapper for FileInfo and its permissions.
    • Constructor Summary

      Constructors 
      Constructor Description
      FileListEntry​(FileInfo fileInfo, UserPermission userPermission, boolean isAdmin, boolean isOwner, java.time.Instant now)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.time.Instant getAvailableFrom()
      File available from time.
      java.time.Instant getAvailableTo()
      File available to time.
      java.time.Instant getCreationTime()
      File creation time.
      long getDirectoryId()
      Id of the Directory this file resides in.
      FileInfo getFileInfo()
      File.
      java.lang.Long getId()
      File id.
      java.time.Instant getLastModifiedTime()
      File last modified time.
      java.lang.String getName()
      File name.
      java.time.Instant getNow()
      Current time.
      java.lang.String getOwner()
      File owner.
      long getSize()
      File size.
      java.lang.String getSizeString()
      File size string.
      java.lang.String getType()
      File type.
      UserPermission getUserPermission()
      User Permissions in containing folder.
      int hashCode()  
      boolean isAdmin()
      Is the user an admin of the group.
      boolean isAvailable​(java.time.Instant time)
      Tests whether this file is available at the given time.
      boolean isDelete()
      Checks whether this file list entry can be deleted.
      boolean isEdit()
      Checks whether this file list entry can be edited.
      boolean isPrivileged()
      Checks whether this file list entry can be accessed because the user is privileged (admin or owner).
      boolean isRead()
      Checks whether this file list entry can be read.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • FileListEntry

        public FileListEntry​(FileInfo fileInfo,
                             UserPermission userPermission,
                             boolean isAdmin,
                             boolean isOwner,
                             java.time.Instant now)
    • Method Detail

      • isPrivileged

        public boolean isPrivileged()
        Checks whether this file list entry can be accessed because the user is privileged (admin or owner).
        Returns:
        true if privileged
      • isRead

        public boolean isRead()
        Checks whether this file list entry can be read.
        Returns:
        true if read is allowed
      • isEdit

        public boolean isEdit()
        Checks whether this file list entry can be edited.
        Returns:
        true if edit is allowed
      • isDelete

        public boolean isDelete()
        Checks whether this file list entry can be deleted.
        Returns:
        true if delete is allowed
      • getId

        public java.lang.Long getId()
        File id.
        Returns:
        file id
      • getType

        public java.lang.String getType()
        File type.
        Returns:
        file type
      • getName

        public java.lang.String getName()
        File name.
        Returns:
        file name
      • getDirectoryId

        public long getDirectoryId()
        Id of the Directory this file resides in.
        Returns:
        directory id
      • getSize

        public long getSize()
        File size.
        Returns:
        file size
      • getSizeString

        public java.lang.String getSizeString()
        File size string.
        Returns:
        file size string
      • getOwner

        public java.lang.String getOwner()
        File owner.
        Returns:
        file owner
      • getAvailableFrom

        public java.time.Instant getAvailableFrom()
        File available from time.
        Returns:
        file available from time
      • getAvailableTo

        public java.time.Instant getAvailableTo()
        File available to time.
        Returns:
        file available to time
      • isAvailable

        public boolean isAvailable​(java.time.Instant time)
        Tests whether this file is available at the given time.
        Parameters:
        time - current time
        Returns:
        if this file is available
      • getCreationTime

        public java.time.Instant getCreationTime()
        File creation time.
        Returns:
        file creation time
      • getLastModifiedTime

        public java.time.Instant getLastModifiedTime()
        File last modified time.
        Returns:
        file last modified time
      • getFileInfo

        public FileInfo getFileInfo()
        File.
      • getUserPermission

        public UserPermission getUserPermission()
        User Permissions in containing folder.
      • isAdmin

        public boolean isAdmin()
        Is the user an admin of the group.
      • getNow

        public java.time.Instant getNow()
        Current time.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

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