public class GlimpseDataPaths extends Object
DataPaths
class (e.g. DncDataPaths
).
If a Glimpse module needs to store module-specific data, it should have its own module-
specific directories, and should provide a module-specific DataPaths
class that
contains the paths of those directories. Module-specific dirs should be subdirs under
the GlimpseDataPaths
dirs.
The value of each GlimpseDataPaths
path is set based on:
The "shared" dir is intended to allow users to share data. It should generally be expected to be read-only.
The "user" dirs are user-specific, and can generally be assumed to be writable. Typically, if data exists in both the user dir and the shared dir, the user dir should take precedence, because the user has more control over it than over the shared dir.
The "cache" dir is intended to hold data that a program can generate if it does not already exist. Cache dirs can be freely deleted when the program is not running.
The "data" dirs are intended to hold data which cannot be regenerated easily.
Modifier and Type | Field and Description |
---|---|
static File |
glimpseSharedDataDir
Parent directory for permanent data (not easy to regenerate) that can be read by
multiple users.
|
static File |
glimpseUserCacheDir
Parent directory for cache data (easy to regenerate) that can be read and written
by the current user.
|
static File |
glimpseUserDataDir
Parent directory for permanent data (not easy to regenerate) that can be read and
written by the current user.
|
Constructor and Description |
---|
GlimpseDataPaths() |
Modifier and Type | Method and Description |
---|---|
static File |
requireExistingDir(File dir)
Throws
RuntimeException if dir is not an existing directory. |
public static final File glimpseSharedDataDir
glimpse.sharedDataDir
GLIMPSE_SHARED_DATA
%ALLUSERSPROFILE%\\Glimpse\\Data
/Library/Application Support/Glimpse/Data
/var/lib/glimpse/data
public static final File glimpseUserDataDir
glimpse.userDataDir
GLIMPSE_USER_DATA
%LOCALAPPDATA%\\Glimpse\\Data
~/Library/Glimpse/Data
~/.local/share/glimpse
public static final File glimpseUserCacheDir
glimpse.userCacheDir
GLIMPSE_USER_CACHE
%LOCALAPPDATA%\\Glimpse\\Cache
~/Library/Caches/Glimpse
~/.cache/glimpse
public static File requireExistingDir(File dir)
RuntimeException
if dir
is not an existing directory.Copyright © 2016 Metron, Inc.. All rights reserved.