try {
int version = source.readByte();
if (version != getVersion()) {
// unknown version
String message = NLS.bind(Messages.resources_readMetaWrongVersion, location.getAbsolutePath(), Integer.toString(version));
ResourceStatus status = new ResourceStatus(IResourceStatus.FAILED_READ_METADATA, message);
throw new ResourceException(status);
}
int entryCount = source.readInt();
for (int i = 0; i < entryCount; i++)
this.entries.put(readEntryKey(source), readEntryValue(source));
} finally {
source.close();
}
} catch (IOException ioe) {
String message = NLS.bind(Messages.resources_readMeta, location.getAbsolutePath());
ResourceStatus status = new ResourceStatus(IResourceStatus.FAILED_READ_METADATA, null, message, ioe);
throw new ResourceException(status);
}
}