private LineLocation findVersionLocation(File file) {
String content;
try {
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 key = reader.key();
if ("version".equals(key)) {
LineLocation loc = new LineLocation();
loc.lineNum = lineNum;
IRegion region = reader.region();
loc.start = region.getOffset();
loc.end = region.getOffset() + region.getLength();
return loc;
}
}
type = reader.next();
lineNum++;
}
} catch (Exception e) {
// ignore
}