Class FileAttributes
java.lang.Object
de.spiritscorp.datasync.model.FileAttributes
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintCompares this file attribute record with another based primarily on file size metrics.booleanRetrieves the native hardware accurate original initialization filesystem creation marker.Retrieves the human-readable string mapping of the original creation timeline entry.Retrieves the unique data signature cryptographic validation token checksum.Retrieves the structural file name node excluding directory routing segments.Retrieves the native hardware accurate last modified metric vector.Retrieves the human-readable string mapping of the modification timeline entry.Retrieves the file path relative to the active deployment endpoint layer root.longgetSize()Retrieves the data payload capacity volume layer quantified in bytes.inthashCode()toString()
-
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 directorycreateTimeString- a string representation of the file creation timestampcreateTime- the rawFileTimeof when the file was createdmodTimeString- a string representation of the last modification timestampmodTime- the rawFileTimeof the last modification eventsize- the size of the file in bytesfileHash- the cryptographic checksum signature (SHA-256 or higher)- Throws:
NullPointerException- ifrelativeFilePathis null
-
-
Method Details
-
compareTo
Compares this file attribute record with another based primarily on file size metrics.- Specified by:
compareToin interfaceComparable<FileAttributes>- Parameters:
o- the otherFileAttributesobject 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
-
equals
-
toString
-
getRelativeFilePath
-
getModTimeString
Retrieves the human-readable string mapping of the modification timeline entry.- Returns:
- the modification timestamp string literal
-
getModTime
-
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
Retrieves the unique data signature cryptographic validation token checksum.- Returns:
- the string-formatted hexadecimal file hash
-
getFileName
Retrieves the structural file name node excluding directory routing segments.- Returns:
- the localized file name string representation
-
getCreateTime
-