Ignore:
Timestamp:
2017-09-14T14:39:53+02:00 (22 months ago)
Author:
bastiK
Message:

see #15229 - add separate interface IBaseDirectories to look up pref, user data and cache dir

Location:
trunk/src/org/openstreetmap/josm/spi/preferences
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/spi/preferences/Config.java

    r12854 r12855  
    55
    66/**
    7  * Class to hold the global preferences object.
     7 * Class to hold the global preferences object and the provider of base directories.
    88 * @since 12847
    99 */
     
    1111
    1212    private static IPreferences preferences;
     13    private static IBaseDirectories baseDirectories;
    1314
    1415    private Config() {
     
    2627
    2728    /**
     29     * Get class that provides the location of certain base directories
     30     * @return the global {@link IBaseDirectories} instance
     31     * @since 12855
     32     */
     33    public static IBaseDirectories getDirs() {
     34        return baseDirectories;
     35    }
     36
     37    /**
    2838     * Install the global preference instance.
    2939     * @param preferences the global preference instance to set (must not be null)
     40     * @since 12847
    3041     */
    3142    public static void setPreferencesInstance(IPreferences preferences) {
    3243        Config.preferences = Objects.requireNonNull(preferences, "preferences");
    3344    }
     45
     46    /**
     47     * Install the global base directories provider.
     48     * @param baseDirectories the global base directories provider instance to set
     49     * (must not be null)
     50     * @since 12855
     51     */
     52    public static void setBaseDirectoriesProvider(IBaseDirectories baseDirectories) {
     53        Config.baseDirectories = Objects.requireNonNull(baseDirectories, "baseDirectories");
     54    }
    3455}
Note: See TracChangeset for help on using the changeset viewer.