}
private Version readVersion(Properties data, String key) throws IllegalDataFormatException {
String versionString = data.getProperty(key);
if (versionString == null) {
throw new IllegalDataFormatException(getErrorMessageHeader() + "Version information is missing.");
}
try {
long versionNumber = Long.parseLong(versionString);
return VersionFactory.fromNumber(versionNumber);
} catch (NumberFormatException e) {
throw new IllegalDataFormatException(getErrorMessageHeader() + "Version information is invalid.");
} catch (IllegalVersionException e) {
throw new IllegalDataFormatException(getErrorMessageHeader() + "Version information is invalid.");
}
}