reader.close();
}
private SoftwareUpdateItem[] readSoftwareUpdateItems(BufferedReader reader, boolean onlyUpdates, boolean dragNdrop, PluginBaseInfo[] baseInfos) throws IOException {
Pattern pluginTypePattern = Pattern.compile("\\[(.*):(.*)\\]");
Pattern keyValuePattern = Pattern.compile("(.+?)=(.*)");
Matcher matcher;
ArrayList<SoftwareUpdateItem> updateItems = new ArrayList<SoftwareUpdateItem>();
//ArrayList<PluginsSoftwareUpdateItem> blockedItems = new ArrayList<PluginsSoftwareUpdateItem>(0);
try {
SoftwareUpdateItem curItem=null;
String line=reader.readLine();
while (line != null) {
matcher=pluginTypePattern.matcher(line);
if (matcher.find()) { // new plugin
String type=matcher.group(1);
String className=matcher.group(2);
if ("plugin".equals(type)) {
curItem=new PluginSoftwareUpdateItem(className);
}
else if ("dataservice".equals(type)) {
curItem=new DataServiceSoftwareUpdateItem(className);
}
else if ("tvbrowser".equals(type)) {
curItem=new TvbrowserSoftwareUpdateItem(className);
}
if (curItem==null) {
throw new IOException("invalid software update file");
}
updateItems.add(curItem);
}
else {
matcher=keyValuePattern.matcher(line);
if (matcher.find()) { // new plugin
String value = matcher.group(2);
value = value.replaceAll("\\\\", ""); // fix wrong HTML encoding in plugin descriptions