Logo Search packages:      
Sourcecode: icedtea-web version File versions  Download package

static File net::sourceforge::jnlp::runtime::JNLPRuntime::getDefaultBaseDir (  )  [inline, static]

Returns the system default base dir for or if not set, prompts the user for the location.

Returns:
the base dir, or null if the user canceled the dialog
Exceptions:
IOException if there was an io exception

Definition at line 330 of file JNLPRuntime.java.

References baseDir, net::sourceforge::jnlp::util::PropertiesFile::getProperty(), HOME_DIR, NETX_DIR, net::sourceforge::jnlp::util::PropertiesFile::setProperty(), and net::sourceforge::jnlp::util::PropertiesFile::store().

Referenced by initialize().

                                           {
        PropertiesFile props = JNLPRuntime.getProperties();

        String baseStr = props.getProperty("basedir");
        if (baseStr != null)
            return new File(baseStr);

        String homeDir = HOME_DIR;
        File baseDir = new File(NETX_DIR);
        if (homeDir == null || (!baseDir.isDirectory() && !baseDir.mkdir()))
            return null;

        props.setProperty("basedir", baseDir.toString());
        props.store();

        return baseDir;
    }


Generated by  Doxygen 1.6.0   Back to index