Class JosmBaseDirectories
- java.lang.Object
-
- org.openstreetmap.josm.data.preferences.JosmBaseDirectories
-
- All Implemented Interfaces:
IBaseDirectories
public final class JosmBaseDirectories extends java.lang.Object implements IBaseDirectories
Class provides base directory locations for JOSM.- Since:
- 13021
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
JosmBaseDirectories.InstanceHolder
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
cacheDir
Internal storage for the cache directory.private java.io.File
preferencesDir
Internal storage for the preference directory.private java.io.File
userdataDir
Internal storage for the user data directory.
-
Constructor Summary
Constructors Modifier Constructor Description private
JosmBaseDirectories()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearMemos()
Clears any previously calculated values used forgetPreferencesDirectory(boolean)
,getCacheDirectory(boolean)
orgetUserDataDirectory(boolean)
.java.io.File
getCacheDirectory(boolean createIfMissing)
Get the directory where user-specific cached content (non-essential data) should be stored.static JosmBaseDirectories
getInstance()
Returns the unique instance.java.io.File
getPreferencesDirectory(boolean createIfMissing)
Get the directory where user-specific configuration and preferences should be stored.java.io.File
getUserDataDirectory(boolean createIfMissing)
Get the directory where user-specific data files should be stored.
-
-
-
Field Detail
-
preferencesDir
private java.io.File preferencesDir
Internal storage for the preference directory.
-
cacheDir
private java.io.File cacheDir
Internal storage for the cache directory.
-
userdataDir
private java.io.File userdataDir
Internal storage for the user data directory.
-
-
Constructor Detail
-
JosmBaseDirectories
private JosmBaseDirectories()
-
-
Method Detail
-
getInstance
public static JosmBaseDirectories getInstance()
Returns the unique instance.- Returns:
- the unique instance
-
getPreferencesDirectory
public java.io.File getPreferencesDirectory(boolean createIfMissing)
Description copied from interface:IBaseDirectories
Get the directory where user-specific configuration and preferences should be stored.- Specified by:
getPreferencesDirectory
in interfaceIBaseDirectories
- Parameters:
createIfMissing
- if true, automatically creates this directory, in case it is missing- Returns:
- the preferences directory
-
getUserDataDirectory
public java.io.File getUserDataDirectory(boolean createIfMissing)
Description copied from interface:IBaseDirectories
Get the directory where user-specific data files should be stored.- Specified by:
getUserDataDirectory
in interfaceIBaseDirectories
- Parameters:
createIfMissing
- if true, automatically creates this directory, in case it is missing- Returns:
- the user data directory
-
getCacheDirectory
public java.io.File getCacheDirectory(boolean createIfMissing)
Description copied from interface:IBaseDirectories
Get the directory where user-specific cached content (non-essential data) should be stored.- Specified by:
getCacheDirectory
in interfaceIBaseDirectories
- Parameters:
createIfMissing
- if true, automatically creates this directory, in case it is missing- Returns:
- the cache directory
-
clearMemos
public void clearMemos()
Clears any previously calculated values used forgetPreferencesDirectory(boolean)
,getCacheDirectory(boolean)
orgetUserDataDirectory(boolean)
. Useful for tests.- Since:
- 14052
-
-