Package org.pepsoft.util
Class XDG
java.lang.Object
org.pepsoft.util.XDG
Utility class for accessing the freedesktop.org "XDG Base Directory
Specification" directories as well as the "well known" user directories as
managed by the xdg-user-dirs tool.
The string-typed constants are set whether or not the directory exists; either to the configured value or a default, if applicable. The file-typed constants are only set if the directory actually exists.
See http://standards.freedesktop.org/basedir-spec/latest/ and http://www.freedesktop.org/wiki/Software/xdg-user-dirs/
Created by Pepijn Schmitz on 19-03-15.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe current user's home directory.static final StringDefines the base directory relative to which user specific non-essential data files should be stored.static final FileXDG_CACHE_HOMEas aFileobject, but only if that directory actually exists.static final StringDefines the preference-ordered set of base directories to search for configuration files in addition to theXDG_CONFIG_HOMEbase directory.static final StringDefines the base directory relative to which user specific configuration files should be stored.static final FileXDG_CONFIG_HOMEas aFileobject, but only if that directory actually exists.static final StringDefines the preference-ordered set of base directories to search for data files in addition to theXDG_DATA_HOMEbase directory.static final StringDefines the base directory relative to which user specific data files should be stored.static final FileXDG_DATA_HOMEas aFileobject, but only if that directory actually exists.static final StringThe location of the "desktop" well known user directory, as specified in the appropriate system or user config file, ornullif it is not configured.static final FileXDG_DESKTOP_DIRas aFileobject, but only ifXDG_DESKTOP_DIRis notnulland that directory actually exists.static final StringThe location of the "documents" well known user directory, as specified in the appropriate system or user config file, ornullif it is not configured.static final FileXDG_DOCUMENTS_DIRas aFileobject, but only ifXDG_DOCUMENTS_DIRis notnulland that directory actually exists.static final StringThe location of the "download" well known user directory, as specified in the appropriate system or user config file, ornullif it is not configured.static final FileXDG_DOWNLOAD_DIRas aFileobject, but only ifXDG_DOWNLOAD_DIRis notnulland that directory actually exists.static final StringThe location of the "music" well known user directory, as specified in the appropriate system or user config file, ornullif it is not configured.static final FileXDG_MUSIC_DIRas aFileobject, but only ifXDG_MUSIC_DIRis notnulland that directory actually exists.static final StringThe location of the "pictures" well known user directory, as specified in the appropriate system or user config file, ornullif it is not configured.static final FileXDG_PICTURES_DIRas aFileobject, but only ifXDG_PICTURES_DIRis notnulland that directory actually exists.static final StringThe location of the "public share" well known user directory, as specified in the appropriate system or user config file, ornullif it is not configured.static final FileXDG_PUBLICSHARE_DIRas aFileobject, but only ifXDG_PUBLICSHARE_DIRis notnulland that directory actually exists.static final StringDefines the base directory relative to which user-specific non-essential runtime files and other file objects (such as sockets, named pipes, ...) should be stored.static final FileXDG_RUNTIME_DIRas aFileobject, but only ifXDG_RUNTIME_DIRis notnulland that directory actually exists.static final StringThe location of the "templates" well known user directory, as specified in the appropriate system or user config file, ornullif it is not configured.static final FileXDG_TEMPLATES_DIRas aFileobject, but only ifXDG_TEMPLATES_DIRis notnulland that directory actually exists.static final StringThe location of the "videos" well known user directory, as specified in the appropriate system or user config file, ornullif it is not configured.static final FileXDG_VIDEOS_DIRas aFileobject, but only ifXDG_VIDEOS_DIRis notnulland that directory actually exists. -
Method Summary
-
Field Details
-
HOME
The current user's home directory. Set to the value of theuser.homesystem property. -
XDG_DATA_HOME
Defines the base directory relative to which user specific data files should be stored. Set to the contents of the XDG_DATA_HOME environment variable, or "HOME/.local/share" if that variable is not present. -
XDG_CONFIG_HOME
Defines the base directory relative to which user specific configuration files should be stored. Set to the contents of the XDG_CONFIG_HOME environment variable, or "HOME/.config" if that variable is not present. -
XDG_DATA_DIRS
Defines the preference-ordered set of base directories to search for data files in addition to theXDG_DATA_HOMEbase directory. Set to the contents of the XDG_DATA_DIRS environment variable, or "/usr/local/share:/usr/share" if that variable is not present. -
XDG_CONFIG_DIRS
Defines the preference-ordered set of base directories to search for configuration files in addition to theXDG_CONFIG_HOMEbase directory. Set to the contents of the XDG_CONFIG_DIRS environment variable, or "/etc/xdg" if that variable is not present. -
XDG_CACHE_HOME
Defines the base directory relative to which user specific non-essential data files should be stored. Set to the contents of the XDG_CACHE_HOME environment variable, or "HOME/.cache" if that variable is not present. -
XDG_RUNTIME_DIR
Defines the base directory relative to which user-specific non-essential runtime files and other file objects (such as sockets, named pipes, ...) should be stored. Set to the contents of the XDG_RUNTIME_DIR environment variable, ornullif that variable is not present. -
XDG_DATA_HOME_FILE
-
XDG_CONFIG_HOME_FILE
-
XDG_CACHE_HOME_FILE
-
XDG_RUNTIME_DIR_FILE
XDG_RUNTIME_DIRas aFileobject, but only ifXDG_RUNTIME_DIRis notnulland that directory actually exists.nullotherwise. -
XDG_DESKTOP_DIR
The location of the "desktop" well known user directory, as specified in the appropriate system or user config file, ornullif it is not configured. -
XDG_DOCUMENTS_DIR
The location of the "documents" well known user directory, as specified in the appropriate system or user config file, ornullif it is not configured. -
XDG_DOWNLOAD_DIR
The location of the "download" well known user directory, as specified in the appropriate system or user config file, ornullif it is not configured. -
XDG_MUSIC_DIR
The location of the "music" well known user directory, as specified in the appropriate system or user config file, ornullif it is not configured. -
XDG_PICTURES_DIR
The location of the "pictures" well known user directory, as specified in the appropriate system or user config file, ornullif it is not configured. -
XDG_PUBLICSHARE_DIR
The location of the "public share" well known user directory, as specified in the appropriate system or user config file, ornullif it is not configured. -
XDG_TEMPLATES_DIR
The location of the "templates" well known user directory, as specified in the appropriate system or user config file, ornullif it is not configured. -
XDG_VIDEOS_DIR
The location of the "videos" well known user directory, as specified in the appropriate system or user config file, ornullif it is not configured. -
XDG_DESKTOP_DIR_FILE
XDG_DESKTOP_DIRas aFileobject, but only ifXDG_DESKTOP_DIRis notnulland that directory actually exists.nullotherwise. -
XDG_DOCUMENTS_DIR_FILE
XDG_DOCUMENTS_DIRas aFileobject, but only ifXDG_DOCUMENTS_DIRis notnulland that directory actually exists.nullotherwise. -
XDG_DOWNLOAD_DIR_FILE
XDG_DOWNLOAD_DIRas aFileobject, but only ifXDG_DOWNLOAD_DIRis notnulland that directory actually exists.nullotherwise. -
XDG_MUSIC_DIR_FILE
XDG_MUSIC_DIRas aFileobject, but only ifXDG_MUSIC_DIRis notnulland that directory actually exists.nullotherwise. -
XDG_PICTURES_DIR_FILE
XDG_PICTURES_DIRas aFileobject, but only ifXDG_PICTURES_DIRis notnulland that directory actually exists.nullotherwise. -
XDG_PUBLICSHARE_DIR_FILE
XDG_PUBLICSHARE_DIRas aFileobject, but only ifXDG_PUBLICSHARE_DIRis notnulland that directory actually exists.nullotherwise. -
XDG_TEMPLATES_DIR_FILE
XDG_TEMPLATES_DIRas aFileobject, but only ifXDG_TEMPLATES_DIRis notnulland that directory actually exists.nullotherwise. -
XDG_VIDEOS_DIR_FILE
XDG_VIDEOS_DIRas aFileobject, but only ifXDG_VIDEOS_DIRis notnulland that directory actually exists.nullotherwise.
-
-
Method Details
-
main
-