Search in sources :

Example 1 with DebugPacker

use of net.pms.external.DebugPacker in project UniversalMediaServer by UniversalMediaServer.

the class DbgPacker method poll.

private void poll() {
    // call the client callbacks
    for (ExternalListener listener : ExternalFactory.getExternalListeners()) {
        if (listener instanceof DebugPacker) {
            LOGGER.debug("Found client {}", listener.name());
            Object obj = ((DebugPacker) listener).dbgpack_cb();
            if (obj instanceof String) {
                add(((String) obj).split(","));
            } else if (obj instanceof String[]) {
                add((String[]) obj);
            }
        }
    }
    PmsConfiguration configuration = PMS.getConfiguration();
    // check dbgpack property in UMS.conf
    LOGGER.debug("Checking dbgpack property in UMS.conf");
    String f = (String) configuration.getCustomProperty("dbgpack");
    if (f != null) {
        add(f.split(","));
    }
    // add confs of connected renderers
    for (RendererConfiguration r : RendererConfiguration.getConnectedRenderersConfigurations()) {
        add(r.getFile());
        if (((DeviceConfiguration) r).isCustomized()) {
            add(((DeviceConfiguration) r).getParentFile());
        }
    }
    // add core items with the default logfile last (LinkedHashMap preserves insertion order)
    String profileDirectory = configuration.getProfileDirectory();
    // add virtual folders file if it exists
    String vfolders = configuration.getVirtualFoldersFile(null);
    if (StringUtils.isNotEmpty(vfolders)) {
        add(new File(profileDirectory, vfolders));
    }
    add(new File(profileDirectory, "WEB.conf"));
    add(new File(configuration.getProfilePath()));
    if (defaultLogFile != null && !defaultLogFile.isEmpty()) {
        add(new File(defaultLogFile + ".prev"));
        add(new File(defaultLogFile));
    }
}
Also used : PmsConfiguration(net.pms.configuration.PmsConfiguration) RendererConfiguration(net.pms.configuration.RendererConfiguration) DebugPacker(net.pms.external.DebugPacker) ExternalListener(net.pms.external.ExternalListener) DeviceConfiguration(net.pms.configuration.DeviceConfiguration) File(java.io.File)

Aggregations

File (java.io.File)1 DeviceConfiguration (net.pms.configuration.DeviceConfiguration)1 PmsConfiguration (net.pms.configuration.PmsConfiguration)1 RendererConfiguration (net.pms.configuration.RendererConfiguration)1 DebugPacker (net.pms.external.DebugPacker)1 ExternalListener (net.pms.external.ExternalListener)1