|
@@ -36,6 +36,7 @@ import com.dmdirc.logger.ErrorLevel;
|
36
|
36
|
import com.dmdirc.updater.Version;
|
37
|
37
|
import java.io.File;
|
38
|
38
|
import java.io.IOException;
|
|
39
|
+import java.io.InputStream;
|
39
|
40
|
import java.lang.reflect.Constructor;
|
40
|
41
|
import java.lang.reflect.InvocationTargetException;
|
41
|
42
|
import java.util.List;
|
|
@@ -306,6 +307,7 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
|
306
|
307
|
* This will load a ConfigFile
|
307
|
308
|
*
|
308
|
309
|
* @return the ConfigFile object for this plugin, or null if the plugin has no config
|
|
310
|
+ * @throws IOException if there is an error with the ResourceManager.
|
309
|
311
|
*/
|
310
|
312
|
private ConfigFile getConfigFile() throws IOException {
|
311
|
313
|
ConfigFile file = null;
|
|
@@ -328,6 +330,22 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
|
328
|
330
|
return file;
|
329
|
331
|
}
|
330
|
332
|
|
|
333
|
+ /**
|
|
334
|
+ * Get the license for this plugin if it exists.
|
|
335
|
+ *
|
|
336
|
+ * @return An InputStream for the license of this plugin, or null if no
|
|
337
|
+ * license found.
|
|
338
|
+ * @throws IOException if there is an error with the ResourceManager.
|
|
339
|
+ */
|
|
340
|
+ public InputStream getLicenseStream() throws IOException {
|
|
341
|
+ final ResourceManager res = getResourceManager();
|
|
342
|
+ if (res.resourceExists("META-INF/license.txt")) {
|
|
343
|
+ return res.getResourceInputStream("META-INF/license.txt");
|
|
344
|
+ }
|
|
345
|
+
|
|
346
|
+ return null;
|
|
347
|
+ }
|
|
348
|
+
|
331
|
349
|
/**
|
332
|
350
|
* Get the defaults, formatters and icons for this plugin.
|
333
|
351
|
*/
|