Source Server Files Comparison - OndraZizka/jboss-migration GitHub Wiki
During startup, the hashes of files of the source server are compared against hashes of known releases. That way, the examined server version is identified, and also, the information about matching, missing, changed or empty files are collected.
The code is in org.jboss.loom.utils.compar
and org.jboss.loom.recog
.
MigrationEngine.announceHashComparisonResults()
formats the results for console output.
Results
The resulting object is ComparisonResult
, and can be found in the context using:
ctx.getSourceServer().getHashesComparisonResult()
Here you can find the directory which was scanned, and the results in the form of Map<Path, FileHashComparer.MatchResult>
, where Path
is the path from server root dir, and MatchResult
is:
public static enum MatchResult {
MATCH, MISMATCH, MISSING, EMPTY;
}
The whole path including server dir may be constructed using ComparisonResult#getWholePath()
.
Implementation
The comparison is done by the implementations of HasHashes#compareHashes( Version version, File serverRootDir )
.
Currently, there's just one: org.jboss.loom.recog.as5.JBossAS5ServerType
.