fix version (#6334)

This commit is contained in:
xy720
2021-07-30 09:25:22 +08:00
committed by GitHub
parent 9ca369aa58
commit a2eb1b9d5b

View File

@ -61,9 +61,10 @@ public class MetaHeader {
}
MetaJsonHeader metaJsonHeader = MetaJsonHeader.read(raf);
if (!MetaJsonHeader.IMAGE_VERSION.equalsIgnoreCase(metaJsonHeader.imageVersion)) {
LOG.warn("Image file {} format mismatch. Expected version is {}, actual is {}",
imageFile.getPath(), MetaJsonHeader.IMAGE_VERSION, metaJsonHeader.imageVersion);
return EMPTY_HEADER;
String errMsg = "Image file " + imageFile.getPath() + " format version mismatch. " +
"Expected version is "+ MetaJsonHeader.IMAGE_VERSION +", actual is" + metaJsonHeader.imageVersion;
// different versions are incompatible
throw new IOException(errMsg);
}
long length = raf.getFilePointer() - MetaMagicNumber.MAGIC_STR.length() - HEADER_LENGTH_SIZE;