Class FileAttributes

java.lang.Object
de.spiritscorp.datasync.model.FileAttributes
All Implemented Interfaces:
Comparable<FileAttributes>

public final class FileAttributes extends Object implements Comparable<FileAttributes>
Immutable value object representing the metadata and diagnostic attributes of a file managed within the synchronization engine context.

This class stores timestamps, cryptographic checksums, sizes, and path configurations required to compute delta states between replication nodes.

Version:
2.0.0
Author:
Tom Spirit
  • Constructor Details

    • FileAttributes

      public FileAttributes(Path relativeFilePath, String createTimeString, FileTime createTime, String modTimeString, FileTime modTime, long size, String fileHash)
      Constructs a comprehensive metadata record for a single tracked file.
      Parameters:
      relativeFilePath - the target file path relative to the source or destination root directory
      createTimeString - a string representation of the file creation timestamp
      createTime - the raw FileTime of when the file was created
      modTimeString - a string representation of the last modification timestamp
      modTime - the raw FileTime of the last modification event
      size - the size of the file in bytes
      fileHash - the cryptographic checksum signature (SHA-256 or higher)
      Throws:
      NullPointerException - if relativeFilePath is null
  • Method Details

    • compareTo

      public int compareTo(FileAttributes o)
      Compares this file attribute record with another based primarily on file size metrics.
      Specified by:
      compareTo in interface Comparable<FileAttributes>
      Parameters:
      o - the other FileAttributes object to compare against
      Returns:
      a negative integer, zero, or a positive integer as this file size is less than, equal to, or greater than the specified object's size
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getRelativeFilePath

      public Path getRelativeFilePath()
      Retrieves the file path relative to the active deployment endpoint layer root.
      Returns:
      the relative Path
    • getModTimeString

      public String getModTimeString()
      Retrieves the human-readable string mapping of the modification timeline entry.
      Returns:
      the modification timestamp string literal
    • getModTime

      public FileTime getModTime()
      Retrieves the native hardware accurate last modified metric vector.
      Returns:
      the high-precision modification FileTime
    • getCreateTimeString

      public String getCreateTimeString()
      Retrieves the human-readable string mapping of the original creation timeline entry.
      Returns:
      the creation timestamp string literal
    • getSize

      public long getSize()
      Retrieves the data payload capacity volume layer quantified in bytes.
      Returns:
      the length of the file as a primitive long value
    • getFileHash

      public String getFileHash()
      Retrieves the unique data signature cryptographic validation token checksum.
      Returns:
      the string-formatted hexadecimal file hash
    • getFileName

      public String getFileName()
      Retrieves the structural file name node excluding directory routing segments.
      Returns:
      the localized file name string representation
    • getCreateTime

      public FileTime getCreateTime()
      Retrieves the native hardware accurate original initialization filesystem creation marker.
      Returns:
      the high-precision creation FileTime