Package org.kendar.sync.lib.twoway
Class StatusAnalyzer
java.lang.Object
org.kendar.sync.lib.twoway.StatusAnalyzer
StatusAnalyzer monitors files in a base directory and tracks changes
for two-way synchronization between client and server.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionanalyze()Analyzes the directory and updates log files with changes since the last runvoidcompact()Compacts the operation.log file by keeping only the latest "CR" operations and creates a .lastcompact.log with the timestamp of the operationCompares two operation.log files and determines synchronization actionsReturns the last compact time from the log fileReturns the last update time from the log file
-
Constructor Details
-
StatusAnalyzer
-
-
Method Details
-
analyze
Analyzes the directory and updates log files with changes since the last run- Returns:
- List of detected changes as LogEntry objects
- Throws:
IOException
-
compact
Compacts the operation.log file by keeping only the latest "CR" operations and creates a .lastcompact.log with the timestamp of the operation- Throws:
IOException
-
compare
Compares two operation.log files and determines synchronization actions- Parameters:
otherLogPath- Path to the other operation.log file- Returns:
- SyncActions containing lists of files to update/delete
- Throws:
IOException
-
compare
- Throws:
IOException
-
getLastCompactTime
Returns the last compact time from the log file -
getLastUpdateTime
Returns the last update time from the log file
-