public PluginInfoDocument(URL updateFileLocation) throws IOException { this.updateFileLocation = updateFileLocation; Properties properties = new Properties(); properties.load(new BufferedInputStream(updateFileLocation.openStream())); String id = properties.getProperty(ID_PROPERTY_NAME); String versionString = properties.getProperty(VERSION_PROPERTY_NAME); Version version = null; if (versionString != null){ version = new Version(versionString); } final String downloadURLStr = properties.getProperty(DOWNLOAD_PROPERTY_NAME); URL downloadURL = null; if (downloadURLStr != null){ downloadURL = new URL(downloadURLStr); } info = new PluginInfo(id, version, downloadURL); final String readmeStr = properties.getProperty(DOC_PROPERTY_NAME); if (readmeStr != null){ info.setReadmeURI(new URL(readmeStr)); } info.setLicense(properties.getProperty(LICENSE_PROPERTY_NAME)); info.setAuthor(properties.getProperty(AUTHOR_PROPERTY_NAME)); info.setLabel(properties.getProperty(LABEL_PROPERTY_NAME)); }
public PluginInfoDocument(URL updateFileLocation) throws IOException { this.updateFileLocation = updateFileLocation; Properties properties = new Properties(); properties.load(new BufferedInputStream(updateFileLocation.openStream())); String id = properties.getProperty(ID_PROPERTY_NAME); String versionString = properties.getProperty(VERSION_PROPERTY_NAME); Version version = null; if (versionString != null){ version = new Version(versionString); } final String downloadURLStr = properties.getProperty(DOWNLOAD_PROPERTY_NAME); URL downloadURL = null; if (downloadURLStr != null){ downloadURL = new URL(downloadURLStr); } info = new PluginInfo(id, version, downloadURL); final String readmeStr = properties.getProperty(DOC_PROPERTY_NAME); if (readmeStr != null){ info.setReadmeURI(new URL(readmeStr)); } info.setLicense(properties.getProperty(LICENSE_PROPERTY_NAME)); info.setAuthor(properties.getProperty(AUTHOR_PROPERTY_NAME)); info.setLabel(properties.getProperty(LABEL_PROPERTY_NAME)); }
info.setReadmeURI(new URL(readmeStr)); info.setLicense(properties.getProperty(LICENSE_PROPERTY_NAME)); info.setAuthor(properties.getProperty(AUTHOR_PROPERTY_NAME)); info.setLabel(properties.getProperty(LABEL_PROPERTY_NAME));