|
@@ -33,7 +33,6 @@ import com.dmdirc.interfaces.config.ConfigProvider;
|
33
|
33
|
import com.dmdirc.interfaces.config.IdentityController;
|
34
|
34
|
import com.dmdirc.logger.ErrorLevel;
|
35
|
35
|
import com.dmdirc.util.SimpleInjector;
|
36
|
|
-import com.dmdirc.util.resourcemanager.ResourceManager;
|
37
|
36
|
import com.dmdirc.util.validators.ValidationResponse;
|
38
|
37
|
|
39
|
38
|
import java.io.File;
|
|
@@ -54,8 +53,6 @@ import java.util.Collections;
|
54
|
53
|
import java.util.HashMap;
|
55
|
54
|
import java.util.List;
|
56
|
55
|
import java.util.Map;
|
57
|
|
-import java.util.Timer;
|
58
|
|
-import java.util.TimerTask;
|
59
|
56
|
import java.util.TreeMap;
|
60
|
57
|
|
61
|
58
|
import javax.annotation.Nonnull;
|
|
@@ -86,8 +83,6 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
|
86
|
83
|
private Plugin plugin;
|
87
|
84
|
/** The classloader used for this Plugin. */
|
88
|
85
|
private PluginClassLoader pluginClassLoader;
|
89
|
|
- /** The resource manager used by this pluginInfo. */
|
90
|
|
- private ResourceManager resourceManager;
|
91
|
86
|
/** Is this plugin only loaded temporarily? */
|
92
|
87
|
private boolean tempLoaded;
|
93
|
88
|
/** List of classes this plugin has. */
|
|
@@ -140,13 +135,6 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
|
140
|
135
|
lastError = "Error loading filesystem: " + ex.getMessage();
|
141
|
136
|
throw new PluginException("Plugin " + filename + " failed to load. " + lastError, ex);
|
142
|
137
|
}
|
143
|
|
- try {
|
144
|
|
- // TODO: Stop using ResourceManager
|
145
|
|
- getResourceManager();
|
146
|
|
- } catch (IOException ioe) {
|
147
|
|
- lastError = "Error with resourcemanager: " + ioe.getMessage();
|
148
|
|
- throw new PluginException("Plugin " + filename + " failed to load. " + lastError, ioe);
|
149
|
|
- }
|
150
|
138
|
updateClassList();
|
151
|
139
|
|
152
|
140
|
if (!myClasses.contains(metadata.getMainClass())) {
|
|
@@ -445,51 +433,6 @@ public class PluginInfo implements Comparable<PluginInfo>, ServiceProvider {
|
445
|
433
|
return pluginFilesystem.getPath(first, more);
|
446
|
434
|
}
|
447
|
435
|
|
448
|
|
- /**
|
449
|
|
- * Gets a resource manager for this plugin
|
450
|
|
- *
|
451
|
|
- * @return The resource manager for this plugin
|
452
|
|
- *
|
453
|
|
- * @throws IOException if there is any problem getting a ResourceManager for this plugin
|
454
|
|
- *
|
455
|
|
- * @deprecated @See getFileSystem()
|
456
|
|
- */
|
457
|
|
- @Deprecated
|
458
|
|
- public ResourceManager getResourceManager() throws IOException {
|
459
|
|
- return getResourceManager(false);
|
460
|
|
- }
|
461
|
|
-
|
462
|
|
- /**
|
463
|
|
- * Get the resource manager for this plugin
|
464
|
|
- *
|
465
|
|
- * @return The resource manager for this plugin
|
466
|
|
- *
|
467
|
|
- * @param forceNew Force a new resource manager rather than using the old one.
|
468
|
|
- *
|
469
|
|
- * @throws IOException if there is any problem getting a ResourceManager for this plugin
|
470
|
|
- * @since 0.6
|
471
|
|
- *
|
472
|
|
- * @deprecated @See getFileSystem()
|
473
|
|
- */
|
474
|
|
- @Deprecated
|
475
|
|
- public synchronized ResourceManager getResourceManager(final boolean forceNew) throws
|
476
|
|
- IOException {
|
477
|
|
- if (resourceManager == null || forceNew) {
|
478
|
|
- resourceManager = ResourceManager.getResourceManager("jar://" + metaData.getPluginUrl().
|
479
|
|
- getPath());
|
480
|
|
-
|
481
|
|
- // Clear the resourcemanager in 10 seconds to stop us holding the file open
|
482
|
|
- new Timer(filename + "-resourcemanagerTimer").schedule(new TimerTask() {
|
483
|
|
- @Override
|
484
|
|
- public void run() {
|
485
|
|
- resourceManager = null;
|
486
|
|
- }
|
487
|
|
- }, 10000);
|
488
|
|
- }
|
489
|
|
-
|
490
|
|
- return resourceManager;
|
491
|
|
- }
|
492
|
|
-
|
493
|
436
|
@Override
|
494
|
437
|
public final boolean isActive() {
|
495
|
438
|
return isLoaded();
|