Class ClientListEntry


  • public class ClientListEntry
    extends java.lang.Object
    The ClientListEntry class holds information reflecting a ListEntry as well as other information which facilitates the filtering, comparison and transportation of a received file.
    Author:
    Ikasan Development Team
    • Constructor Detail

      • ClientListEntry

        public ClientListEntry()
        Default Constructor
    • Method Detail

      • getUri

        public java.net.URI getUri()
        Returns:
        the uri
      • setUri

        public void setUri​(java.net.URI uri)
        Parameters:
        uri - the uri to set
      • getClientId

        public java.lang.String getClientId()
        Returns:
        the clientId
      • setClientId

        public void setClientId​(java.lang.String clientId)
        Parameters:
        clientId - the clientId to set
      • getAtime

        public long getAtime()
        Returns:
        the atime
      • setAtime

        public void setAtime​(long atime)
        Parameters:
        atime - the atime to set
      • setName

        public void setName​(java.lang.String name)
        Set the name
        Parameters:
        name -
      • getName

        public java.lang.String getName()
        Get the list entry name
        Returns:
        name
      • setFullPath

        public void setFullPath​(java.lang.String fullPath)
        Set the fullPath
        Parameters:
        fullPath -
      • getFullPath

        public java.lang.String getFullPath()
        Get the full Path
        Returns:
        fullPath
      • getAtimeString

        public java.lang.String getAtimeString()
        Returns:
        the atimeString
      • setAtimeString

        public void setAtimeString​(java.lang.String atimeString)
        Parameters:
        atimeString - the atimeString to set
      • getDtLastAccessed

        public java.util.Date getDtLastAccessed()
        Returns:
        the dtLastAccessed
      • setDtLastAccessed

        public void setDtLastAccessed​(java.util.Date dtLastAccessed)
        Parameters:
        dtLastAccessed - the dtLastAccessed to set
      • getDtLastModified

        public java.util.Date getDtLastModified()
        Returns:
        the dtLastModified
      • setDtLastModified

        public void setDtLastModified​(java.util.Date dtLastModified)
        Parameters:
        dtLastModified - the dtLastModified to set
      • getExtended

        public java.util.ArrayList<java.lang.String> getExtended()
        Returns:
        the extended
      • setExtended

        public void setExtended​(java.util.ArrayList<java.lang.String> extended)
        Parameters:
        extended - the extended to set
      • getFlags

        public int getFlags()
        Returns:
        the flags
      • setFlags

        public void setFlags​(int flags)
        Parameters:
        flags - the flags to set
      • getGid

        public java.lang.String getGid()
        Returns:
        the gid
      • setGid

        public void setGid​(java.lang.String gid)
        Parameters:
        gid - the gid to set
      • isDirectory

        public boolean isDirectory()
        Returns:
        the isDirectory
      • isDirectory

        public void isDirectory​(boolean isDir)
        Parameters:
        isDir - the isDirectory to set
      • isLink

        public boolean isLink()
        Returns:
        the isLink
      • isLink

        public void isLink​(boolean isLnk)
        Parameters:
        isLnk - the isLink to set
      • getLongFilename

        public java.lang.String getLongFilename()
        Returns:
        the longFilename
      • setLongFilename

        public void setLongFilename​(java.lang.String longFilename)
        Parameters:
        longFilename - the longFilename to set
      • getMtime

        public long getMtime()
        Returns:
        the mtime
      • setMtime

        public void setMtime​(long mtime)
        Parameters:
        mtime - the mtime to set
      • getMtimeString

        public java.lang.String getMtimeString()
        Returns:
        the mtimeString
      • setMtimeString

        public void setMtimeString​(java.lang.String mtimeString)
        Parameters:
        mtimeString - the mtimeString to set
      • getPermissions

        public int getPermissions()
        Returns:
        the permissions
      • setPermissions

        public void setPermissions​(int permissions)
        Parameters:
        permissions - the permissions to set
      • getPermissionsString

        public java.lang.String getPermissionsString()
        Returns:
        the permissionsString
      • setPermissionsString

        public void setPermissionsString​(java.lang.String permissionsString)
        Parameters:
        permissionsString - the permissionsString to set
      • getSize

        public long getSize()
        Returns:
        the size
      • setSize

        public void setSize​(long size)
        Parameters:
        size - the size to set
      • getUid

        public java.lang.String getUid()
        Returns:
        the uid
      • setUid

        public void setUid​(java.lang.String uid)
        Parameters:
        uid - the uid to set
      • compareTo

        public int compareTo​(java.lang.Object object)
                      throws java.lang.ClassCastException
        Method used to implement the Comparable interface and compare/order ClientListEntries according to the following natural order:
        1. Uri
        2. LastModified
        3. LastAccessed
        4. Size
        Parameters:
        object - The ClientListEntry to compare with this one.
        Returns:
        0 if the objects are identical, -1 if the object compared to this one is relatively smaller, 1 if the object compared to this one is relatively bigger.
        Throws:
        java.lang.ClassCastException - If the object parameter is not of type ClientListEntry
      • toPersistObject

        public FileFilter toPersistObject()
        Used to create a FileFilter object which can be used for persisting/filtering the entry.

        Note: size is currently downcast from long to int. Maybe change the persist object and table definition to handle this.

        NOTE: Order is important due to the Hibernate mapping
        Returns:
        An FileFilter object holding this entry's URI as string, lastModified, lastAccessed and size.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
        Returns:
        A formatted representation of this object.
      • evalRelativePath

        public java.lang.String evalRelativePath​(java.lang.String baseDirectory)
        Get the relativePath of the base directory to the directory containing the target file e.g if base = /base and filePath = /base/reports/20210608/file.txt then relativePath = reports/20210608
        Parameters:
        baseDirectory - - the base directory to get the relative path from
        Returns:
        the relativePath from the base directory to the directory containing the file
      • equals

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

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
        See Also:
        Object.hashCode()