org.eclipse.ease.ui.scripts.preferences

## Class PreferencesHelper

- java.lang.Object
- - org.eclipse.ease.ui.scripts.preferences.PreferencesHelper

    public final class PreferencesHelper
    extends java.lang.Object

Helper methods to access script storage preferences.

### Method Summary

All Methods Static Methods Concrete Methods
`static void` `addLocation(IScriptLocation entry)` Add a script storage location to the preferences.
`static java.lang.String` `getDefaultScriptStorageLocation()` Get the default location to store recorded/imported scripts to.
`static IScriptLocation` `getLocationForNode(org.osgi.service.prefs.Preferences node)` Create a location for a given preferences node.
`static java.util.Collection<IScriptLocation>` `getLocations()` Returns a collection of script locations as stored in the preferences.
`static java.lang.String` `getScriptStorageLocation()` Get the default location to store recorded/imported scripts to.
`static java.lang.String` `getUserScriptStorageLocation()` Get the storage location for recorded/imported scripts as set by the user.
`static void` `removeLocation(java.lang.String locationURI)` Remove a script storage location from preferences.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### getScriptStorageLocation

    public static java.lang.String getScriptStorageLocation()

Get the default location to store recorded/imported scripts to. If no path was defined by the user, a default path within the .metadata workspace folder is returned. As the user might change the default path also invalid entries might be returned.

Returns:
  path to default script storage location

#### getUserScriptStorageLocation

    public static java.lang.String getUserScriptStorageLocation()

Get the storage location for recorded/imported scripts as set by the user. If the user did not explicitly set a location, `null` is returned.

Returns:
  user provided storage location or `null`

#### getDefaultScriptStorageLocation

    public static java.lang.String getDefaultScriptStorageLocation()

Get the default location to store recorded/imported scripts to. Returns the hard-coded default location within the workspace/.metadata folder.

Returns:
  path to default script storage location

#### getLocations

    public static java.util.Collection<IScriptLocation> getLocations()

Returns a collection of script locations as stored in the preferences. Converts preference data to `IEntry` elements.

Returns:
  all configured script locations

#### getLocationForNode

    public static IScriptLocation getLocationForNode(org.osgi.service.prefs.Preferences node)

Create a location for a given preferences node. Reads preferences data to recreate the node.

Parameters:
  `node` - preferences node to read
Returns:
  script location

#### addLocation

    public static void addLocation(IScriptLocation entry)

Add a script storage location to the preferences.

Parameters:
  `entry` - location to add

#### removeLocation

    public static void removeLocation(java.lang.String locationURI)

Remove a script storage location from preferences.

Parameters:
  `locationURI` - location of storage