- java.lang.Object
-
- smartefact.xdg.basedir.XdgBaseDir
-
public final class XdgBaseDir extends Object
Utilities for the XDG Base Directory specification.Specification: XDG Base Directory 0.8
- Author:
- Laurent Pireyn
- See Also:
- XDG Base Directory Specification
-
-
Method Summary
-
-
-
Method Detail
-
getInstance
@NotNull public static @NotNull XdgBaseDir getInstance()
-
getHome
@Contract(pure=true) @NotNull public @NotNull Path getHome()
Returns the home directory.This implementation is based on the
HOMEenvironment variable, not on theuser.homesystem property (although they should have the same value).- Returns:
- the home directory (never
null)
-
getCacheHome
@Contract(pure=true) @NotNull public @NotNull Path getCacheHome()
Returns the cached data directory.- Returns:
- the cached data directory (never
null)
-
getConfigHome
@Contract(pure=true) @NotNull public @NotNull Path getConfigHome()
Returns the configuration directory.- Returns:
- the configuration directory (never
null)
-
getDataHome
@Contract(pure=true) @NotNull public @NotNull Path getDataHome()
Returns the data directory.- Returns:
- the data directory (never
null)
-
getStateHome
@Contract(pure=true) @NotNull public @NotNull Path getStateHome()
Returns the state data directory.- Returns:
- the state data directory (never
null)
-
getRuntimeDir
@Contract(pure=true) @Nullable public @Nullable Path getRuntimeDir()
Returns the runtime directory.This may be
nullas it has no default value.- Returns:
- the runtime directory (maybe
null)
-
getBinDir
@Contract(pure=true) @NotNull public @NotNull Path getBinDir()
Returns the user binary directory.- Returns:
- the user binary directory (never
null)
-
getConfigDirs
@Contract(pure=true) @NotNull public @NotNull List<@NotNull Path> getConfigDirs()
Returns the configuration directories.- Returns:
- the configuration directories (never
null)
-
getDataDirs
@Contract(pure=true) @NotNull public @NotNull List<@NotNull Path> getDataDirs()
Returns the data directories.- Returns:
- the data directories (never
null)
-
getCandidateConfigDirs
@Contract(pure=true) @NotNull public @NotNull Stream<@NotNull Path> getCandidateConfigDirs()
-
getCandidateDataDirs
@Contract(pure=true) @NotNull public @NotNull Stream<@NotNull Path> getCandidateDataDirs()
-
getConfigFiles
@Contract(pure=true) @NotNull public @NotNull Stream<@NotNull Path> getConfigFiles(@NotNull @NotNull String dirName, @NotNull @NotNull String fileName)
-
getDataFiles
@Contract(pure=true) @NotNull public @NotNull Stream<@NotNull Path> getDataFiles(@NotNull @NotNull String dirName, @NotNull @NotNull String fileName)
-
-