private LineLocation findBundleVersionHeader(IFile bndFile) throws Exception {
File file = bndFile.getLocation().toFile();
String content = IO.collect(file);
PropertiesLineReader reader = new PropertiesLineReader(content);
int lineNum = 1;
LineType type = reader.next();
while (type != LineType.eof) {
if (type == LineType.entry) {
String entryKey = reader.key();
if (Constants.BUNDLE_VERSION.equals(entryKey)) {
LineLocation loc = new LineLocation();
loc.lineNum = lineNum;
IRegion region = reader.region();
loc.start = region.getOffset();
loc.end = region.getOffset() + region.getLength();
return loc;
}
}
lineNum++;
type = reader.next();
}
return null;
}