com.rapidminer.tools
Class ParameterService

java.lang.Object
  extended by com.rapidminer.tools.ParameterService

public class ParameterService
extends java.lang.Object

This class loads the yalrc property files and provides methods to access them. It also provides methods to create files relative to the RapidMiner home directory. As the getProperty(String) method throws an exception if the parameter is not set, the System.getProperty(String) methods should be used if this is not desired.

Author:
Simon Fischer, Ingo Mierswa

Constructor Summary
ParameterService()
           
 
Method Summary
static boolean booleanValue(java.lang.String value, boolean deflt)
          Returns true if value is "true", "yes", "y" or "on".
static void copyMainUserConfigFile(VersionNumber oldVersion, VersionNumber newVersion)
           
static void ensureRapidMinerHomeSet()
          Tries to find the rapidminer.home directory if the property is not set and sets it.
static java.io.File getConfigFile(java.lang.String name)
           
static java.io.File getLibraryFile(java.lang.String name)
           
static java.io.File getMainUserConfigFile()
          Returns the main user configuration file containing the version number and the OS.
static java.io.File getPluginDir()
           
static java.io.File getRapidMinerHome()
           
static java.io.File getSampleDir()
           
static java.io.File getSampleFile(java.lang.String filename)
           
static java.io.File getSourceFile(java.lang.String filename)
           
static java.io.File getUserConfigFile(java.lang.String name)
          Returns the configuration file in the user dir .rapidminer and automatically adds the current version number if it is a rc file.
static java.io.File getUserRapidMinerDir()
           
static java.io.File getUserSampleFile(java.lang.String filename)
           
static java.io.File getUserWorkspace()
          Returns the user workspace (if one was set).
static java.io.File getVersionedUserConfigFile(VersionNumber versionNumber, java.lang.String name)
           
static void init()
          Invokes init(InputStream, boolean) with a null stream meaning that the core operators.xml is loaded and with addWekaOperators = true.
static void init(java.io.InputStream operatorsXMLStream, boolean addWekaOperators)
          Registers the operators from the stream and reads the rc file.
static void init(java.io.InputStream operatorsXMLStream, java.io.InputStream additionalXMLStream, boolean addWekaOperators)
          Registers the operators from the stream and reads the rc file.
static void init(java.io.InputStream operatorsXMLStream, java.io.InputStream additionalXMLStream, java.io.InputStream additionalIOObjectsXMLStream, boolean addWekaOperators)
          Registers the operators from the stream and reads the rc file.
static void setUserWorkspace(java.io.File workspace)
          Sets the current user workspace to this file.
static void writeProperties(java.util.Properties properties, java.io.File file)
           
static void writePropertyIntoMainUserConfigFile(java.lang.String key, java.lang.String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParameterService

public ParameterService()
Method Detail

ensureRapidMinerHomeSet

public static void ensureRapidMinerHomeSet()
Tries to find the rapidminer.home directory if the property is not set and sets it.


init

public static void init()
Invokes init(InputStream, boolean) with a null stream meaning that the core operators.xml is loaded and with addWekaOperators = true. Registers the operators from the stream and reads the rc file.


init

public static void init(java.io.InputStream operatorsXMLStream,
                        boolean addWekaOperators)
Registers the operators from the stream and reads the rc file. If the stream is null this method tries to read the core operators.xml.


init

public static void init(java.io.InputStream operatorsXMLStream,
                        java.io.InputStream additionalXMLStream,
                        boolean addWekaOperators)
Registers the operators from the stream and reads the rc file. If the stream is null this method tries to read the core operators.xml.


init

public static void init(java.io.InputStream operatorsXMLStream,
                        java.io.InputStream additionalXMLStream,
                        java.io.InputStream additionalIOObjectsXMLStream,
                        boolean addWekaOperators)
Registers the operators from the stream and reads the rc file. If the stream is null this method tries to read the core operators.xml. If the java start parameters contain additional operators.xml or ioobjects.xml, they are used for initialization.


getUserWorkspace

public static java.io.File getUserWorkspace()
Returns the user workspace (if one was set). Might return null if no workspace definition can be found. This method also creates the workspace directory if the file does not exist.


setUserWorkspace

public static final void setUserWorkspace(java.io.File workspace)
Sets the current user workspace to this file. If the directory does not exist it will be created. The absolute path is also written into the corresponding user config file. Additionally, the favorites for the file chooser will be extended by the workspace and sample links if appropriate.


copyMainUserConfigFile

public static void copyMainUserConfigFile(VersionNumber oldVersion,
                                          VersionNumber newVersion)

writeProperties

public static void writeProperties(java.util.Properties properties,
                                   java.io.File file)

writePropertyIntoMainUserConfigFile

public static void writePropertyIntoMainUserConfigFile(java.lang.String key,
                                                       java.lang.String value)

getMainUserConfigFile

public static java.io.File getMainUserConfigFile()
Returns the main user configuration file containing the version number and the OS.


getUserConfigFile

public static java.io.File getUserConfigFile(java.lang.String name)
Returns the configuration file in the user dir .rapidminer and automatically adds the current version number if it is a rc file.


getVersionedUserConfigFile

public static java.io.File getVersionedUserConfigFile(VersionNumber versionNumber,
                                                      java.lang.String name)

getUserRapidMinerDir

public static java.io.File getUserRapidMinerDir()

getRapidMinerHome

public static java.io.File getRapidMinerHome()

getConfigFile

public static java.io.File getConfigFile(java.lang.String name)

getLibraryFile

public static java.io.File getLibraryFile(java.lang.String name)

getSampleFile

public static java.io.File getSampleFile(java.lang.String filename)

getUserSampleFile

public static java.io.File getUserSampleFile(java.lang.String filename)

getSourceFile

public static java.io.File getSourceFile(java.lang.String filename)

getPluginDir

public static java.io.File getPluginDir()

getSampleDir

public static java.io.File getSampleDir()

booleanValue

public static boolean booleanValue(java.lang.String value,
                                   boolean deflt)
Returns true if value is "true", "yes", "y" or "on". Returns false if value is "false", "no", "n" or "off". Otherwise returns deflt.



Copyright © 2001-2009 by Rapid-I