org.kde.koala
public class KStandardDirs extends Object implements QtSupport
See Also: KGlobalSettings
UNKNOWN: Site-independent access to standard KDE directories.
Constructor Summary | |
---|---|
protected | KStandardDirs(Class dummy) |
KStandardDirs()
KStandardDirs' constructor. |
Method Summary | |
---|---|
boolean | addCustomized(KConfig config)
Reads customized entries out of the given config object and add
them via addResourceDirs(). |
void | addKDEDefaults()
This function adds the defaults that are used by the current
KDE version.
|
void | addPrefix(String dir)
Adds another search dir to front of the fsstnd list.
|
boolean | addResourceDir(String type, String absdir)
Adds absolute path at the end of the search path for
particular types (for example in case of icons where
the user specifies extra paths).
|
boolean | addResourceType(String type, String relativename)
Adds suffixes for types.
|
void | addXdgConfigPrefix(String dir)
Adds another search dir to front of the XDG_CONFIG_XXX list
of prefixes.
|
void | addXdgDataPrefix(String dir)
Adds another search dir to front of the XDG_DATA_XXX list
of prefixes.
|
ArrayList | allTypes()
This function will return a list of all the types that KStandardDirs
supports. |
int | calcResourceHash(String type, String filename, boolean deep)
Returns a number that identifies this version of the resource.
|
void | dispose() Delete the wrapped C++ instance ahead of finalize() |
static boolean | exists(String fullPath)
Checks for existence and accessability of a file or directory.
|
protected void | finalize() Deletes the wrapped C++ instance |
static int | findAllExe(String[] list, String appname, String pathstr, boolean ignoreExecBit)
Finds all occurrences of an executable in the system path. |
static int | findAllExe(String[] list, String appname, String pathstr) |
static int | findAllExe(String[] list, String appname) |
ArrayList | findAllResources(String type, String filter, boolean recursive, boolean unique)
Tries to find all resources with the specified type.
|
ArrayList | findAllResources(String type, String filter, boolean recursive) |
ArrayList | findAllResources(String type, String filter) |
ArrayList | findAllResources(String type) |
ArrayList | findAllResources(String type, String filter, boolean recursive, boolean unique, String[] relPaths)
Tries to find all resources with the specified type.
|
ArrayList | findDirs(String type, String reldir)
Tries to find all directories whose names consist of the
specified type and a relative path. |
static String | findExe(String appname, String pathstr, boolean ignoreExecBit)
Finds the executable in the system path.
|
static String | findExe(String appname, String pathstr) |
static String | findExe(String appname) |
String | findResource(String type, String filename)
Tries to find a resource in the following order:
|
String | findResourceDir(String type, String filename)
Tries to find the directory the file is in.
|
boolean | isDisposed() Has the wrapped C++ instance been deleted? |
boolean | isRestrictedResource(String type, String relPath)
Checks whether a resource is restricted as part of the KIOSK
framework. |
boolean | isRestrictedResource(String type) |
static String | kde_default(String type)
This returns a default relative path for the standard KDE
resource types. |
static String | kfsstnd_defaultbindir()
Returns the default bin directory in which KDE executables are stored. |
static String | kfsstnd_defaultprefix()
Returns the default toplevel directory where KDE is installed. |
String | kfsstnd_prefixes() |
String | kfsstnd_xdg_conf_prefixes() |
String | kfsstnd_xdg_data_prefixes() |
String | localkdedir()
Returns the toplevel directory in which KStandardDirs
will store things. |
String | localxdgconfdir() |
String | localxdgdatadir() |
static boolean | makeDir(String dir, int mode)
Recursively creates still-missing directories in the given path.
|
static boolean | makeDir(String dir) |
static String | realFilePath(String filename)
Expands all symbolic links and resolves references to
'/./', '/../' and extra '/' characters in filename
and returns the canonicalized absolute pathname.
|
static String | realPath(String dirname)
Expands all symbolic links and resolves references to
'/./', '/../' and extra '/' characters in dirname
and returns the canonicalized absolute pathname.
|
String | relativeLocation(String type, String absPath)
Converts an absolute path to a path relative to a certain
resource.
|
ArrayList | resourceDirs(String type)
This function is used internally by almost all other function as
it serves and fills the directories cache. |
String | saveLocation(String type, String suffix, boolean create)
Finds a location to save files into for the given type
in the user's home directory. |
String | saveLocation(String type, String suffix) |
String | saveLocation(String type) |
static ArrayList | systemPaths(String pstr)
Returns an ArrayList list of pathnames in the system path. |
static ArrayList | systemPaths() |
UNKNOWN: KStandardDirs' constructor.
Parameters: config The object the entries are read from. This should contain global config files
Returns: true if new config paths have been added
from config.
UNKNOWN: Reads customized entries out of the given config object and add them via addResourceDirs().
UNKNOWN: This function adds the defaults that are used by the current KDE version.
fsstnd
list.
Parameters: dir The directory to append relative paths to.
UNKNOWN: Adds another search dir to front of the fsstnd
list.
Parameters: type Specifies a short descriptive string to access files of this type. absdir Points to directory where to look for this specific type. Non-existant directories may be saved but pruned.
Returns: true if successful, false otherwise.
UNKNOWN: Adds absolute path at the end of the search path for particular types (for example in case of icons where the user specifies extra paths).
Parameters: type Specifies a short descriptive string to access files of this type. relativename Specifies a directory relative to the root of the KFSSTND.
Returns: true if successful, false otherwise.
UNKNOWN: Adds suffixes for types.
Parameters: dir The directory to append relative paths to.
UNKNOWN: Adds another search dir to front of the XDG_CONFIG_XXX list of prefixes.
Parameters: dir The directory to append relative paths to.
UNKNOWN: Adds another search dir to front of the XDG_DATA_XXX list of prefixes.
Returns: All types that KDE supports
UNKNOWN: This function will return a list of all the types that KStandardDirs supports.
Parameters: type The type of the wanted resource filename A relative filename of the resource. deep If true, all resources are taken into account otherwise only the one returned by findResource().
Returns: A number identifying the current version of the resource.
UNKNOWN: Returns a number that identifies this version of the resource.
Parameters: fullPath the path to check. IMPORTANT: must end with a slash if expected to be a directory (and no slash for a file, obviously).
Returns: true if the directory exists
UNKNOWN: Checks for existence and accessability of a file or directory.
Parameters: list Will be filled with the pathnames of all the executables found. Will be empty if the executable was not found. appname The name of the executable for which to search. pathstr The path list which will be searched. If this is 0 (default), the $PATH environment variable will be searched. ignoreExecBit If true, an existing file will be returned even if its executable bit is not set.
Returns: The number of executables found, 0 if none were found.
See Also: KStandardDirs
UNKNOWN: Finds all occurrences of an executable in the system path.
Parameters: type The type of resource to locate directories for. filter Only accept filenames that fit to filter. The filter may consist of an optional directory and a QRegExp wildcard expression. E.g. "images\.jpg". Use null if you do not want a filter. recursive Specifies if the function should decend into subdirectories. unique If specified, only return items which have unique suffixes - suppressing duplicated filenames.
Returns: List of all the files whose filename matches the specified filter.
UNKNOWN: Tries to find all resources with the specified type.
Parameters: type The type of resource to locate directories for. filter Only accept filenames that fit to filter. The filter may consist of an optional directory and a QRegExp wildcard expression. E.g. "images\.jpg". Use null if you do not want a filter. recursive Specifies if the function should decend into subdirectories. unique If specified, only return items which have unique suffixes. relPaths The list to store the relative paths into These can be used later to .locate() the file
Returns: List of all the files whose filename matches the specified filter.
UNKNOWN: Tries to find all resources with the specified type.
Parameters: type The type of the base directory. reldir Relative directory.
Returns: A list of matching directories, or an empty list if the resource specified is not found.
UNKNOWN: Tries to find all directories whose names consist of the specified type and a relative path.
Parameters: appname The name of the executable file for which to search. pathstr The path which will be searched. If this is null (default), the $PATH environment variable will be searched. ignoreExecBit If true, an existing file will be returned even if its executable bit is not set.
Returns: The path of the executable. If it was not found, it will return null.
See Also: KStandardDirs
UNKNOWN: Finds the executable in the system path.
Parameters: type The type of the wanted resource filename A relative filename of the resource.
Returns: A full path to the filename specified in the second argument, or null if not found.
UNKNOWN: Tries to find a resource in the following order:
Parameters: type The type of the wanted resource filename A relative filename of the resource.
Returns: The directory where the file specified in the second argument is located, or null if the type of resource specified is unknown or the resource cannot be found.
UNKNOWN: Tries to find the directory the file is in.
Parameters: type The type of the resource to check relPath A relative path in the resource.
Returns: True if the resource is restricted.
UNKNOWN: Checks whether a resource is restricted as part of the KIOSK framework.
Returns: Static default for the specified resource. You should probably be using locate() or locateLocal() instead.
See Also: KStandardDirs KStandardDirs
UNKNOWN: This returns a default relative path for the standard KDE resource types.
UNKNOWN:
UNKNOWN:
UNKNOWN:
UNKNOWN:
UNKNOWN:
Returns: the toplevel directory
UNKNOWN: Returns the toplevel directory in which KStandardDirs will store things.
Returns: $XDG_CONFIG_HOME See also http://www.freedesktop.org/standards/basedir/draft/basedir-spec/basedir-spec.html
UNKNOWN:
Returns: $XDG_DATA_HOME See also http://www.freedesktop.org/standards/basedir/draft/basedir-spec/basedir-spec.html
UNKNOWN:
Parameters: dir Absolute path of the directory to be made. mode Directory permissions.
Returns: true if successful, false otherwise
UNKNOWN: Recursively creates still-missing directories in the given path.
filename
and returns the canonicalized absolute pathname.
The resulting path will have no symbolic link, '/./'
or '/../' components.UNKNOWN: Expands all symbolic links and resolves references to '/.
dirname
and returns the canonicalized absolute pathname.
The resulting path will have no symbolic link, '/./'
or '/../' components.UNKNOWN: Expands all symbolic links and resolves references to '/.
Parameters: type The type of resource. absPath An absolute path to make relative.
Returns: A relative path relative to resource type
that
will find absPath.
If no such relative path exists, absPath
will be returned unchanged.
UNKNOWN: Converts an absolute path to a path relative to a certain resource.
Parameters: type The type of resource
Returns: The list of possible directories for the specified type.
The function updates the cache if possible. If the resource
type specified is unknown, it will return an empty list.
Note, that the directories are assured to exist beside the save
location, which may not exist, but is returned anyway.
UNKNOWN: This function is used internally by almost all other function as it serves and fills the directories cache.
Parameters: type The type of location to return. suffix A subdirectory name.
Makes it easier for you to create subdirectories.
You can't pass filenames here, you _have_ to pass
directory names only and add possible filename in
that directory yourself. A directory name always has a
trailing slash ('/'). create If set, saveLocation() will create the directories
needed (including those given by suffix
).
Returns: A path where resources of the specified type should be saved, or null if the resource type is unknown.
UNKNOWN: Finds a location to save files into for the given type in the user's home directory.
Parameters: pstr The path which will be searched. If this is null (default), the $PATH environment variable will be searched.
Returns: an ArrayList list of pathnames in the system path.
UNKNOWN: Returns an ArrayList list of pathnames in the system path.