Search in sources :

Example 1 with LocalWorkingDirectory

use of net.sourceforge.processdash.tool.bridge.client.LocalWorkingDirectory in project processdash by dtuma.

the class DisplayConfig method loadConfigurationInformation.

private void loadConfigurationInformation() {
    dataDirectory = null;
    dataURL = null;
    configFile = new File(DashController.getSettingsFileName());
    WorkingDirectory workingDir = ((ProcessDashboard) getDashboardContext()).getWorkingDirectory();
    if (workingDir instanceof BridgedWorkingDirectory) {
        BridgedWorkingDirectory bwd = (BridgedWorkingDirectory) workingDir;
        dataURL = bwd.getDescription();
        dataDirectory = bwd.getTargetDirectory();
        if (dataDirectory == null)
            configFile = null;
        else
            configFile = new File(dataDirectory, configFile.getName());
    } else if (workingDir instanceof LocalWorkingDirectory) {
        LocalWorkingDirectory lwd = (LocalWorkingDirectory) workingDir;
        dataDirectory = lwd.getTargetDirectory();
    }
    DashPackage dash = TemplateLoader.getPackage(DASHBOARD_PACKAGE_ID);
    if (dash != null && StringUtils.hasValue(dash.filename)) {
        File dashJar = new File(dash.filename);
        installationDirectory = dashJar.getParentFile();
    }
    appTemplateDirectory = TemplateLoader.getApplicationTemplateDir();
    jvmInfo = System.getProperty("java.vendor") + " JRE " + System.getProperty("java.version") + "; " + System.getProperty("os.name");
}
Also used : BridgedWorkingDirectory(net.sourceforge.processdash.tool.bridge.client.BridgedWorkingDirectory) WorkingDirectory(net.sourceforge.processdash.tool.bridge.client.WorkingDirectory) LocalWorkingDirectory(net.sourceforge.processdash.tool.bridge.client.LocalWorkingDirectory) LocalWorkingDirectory(net.sourceforge.processdash.tool.bridge.client.LocalWorkingDirectory) ProcessDashboard(net.sourceforge.processdash.ProcessDashboard) BridgedWorkingDirectory(net.sourceforge.processdash.tool.bridge.client.BridgedWorkingDirectory) File(java.io.File) DashPackage(net.sourceforge.processdash.templates.DashPackage)

Aggregations

File (java.io.File)1 ProcessDashboard (net.sourceforge.processdash.ProcessDashboard)1 DashPackage (net.sourceforge.processdash.templates.DashPackage)1 BridgedWorkingDirectory (net.sourceforge.processdash.tool.bridge.client.BridgedWorkingDirectory)1 LocalWorkingDirectory (net.sourceforge.processdash.tool.bridge.client.LocalWorkingDirectory)1 WorkingDirectory (net.sourceforge.processdash.tool.bridge.client.WorkingDirectory)1