Class AbstractPlatform
java.lang.Object
org.eclipse.rdf4j.common.platform.AbstractPlatform
- All Implemented Interfaces:
Platform
- Direct Known Subclasses:
DefaultPlatform,PlatformBase,PosixPlatform,WindowsPlatform
Utility base class for Platform implementations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected final org.slf4j.Loggerprotected Stringprotected StringFields inherited from interface org.eclipse.rdf4j.common.platform.Platform
APPDATA_BASEDIR_PROPERTY, OLD_DATADIR_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal FileReturns the directory in which Aduna applications can store their application-dependent data, returns 'getOSApplicationDataDir' unless the system property "aduna.platform.applicationdata.dir" has been set.final FilegetApplicationDataDir(String applicationName) Returns the directory in which a specific application can store all its application-dependent data.final FilegetOSApplicationDataDir(String applicationName) Returns the operating system dependent application data directory.getRelativeApplicationDataDir(String applicationName) Get the directory relative to getApplicationDataDir() for the specified application.getRelativeApplicationDataDir(String applicationName, boolean caseSensitive, boolean replaceWhitespace, boolean replaceColon) Get the relative name of the application directoryReturns the directory for the current user.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.rdf4j.common.platform.Platform
dataDirPreserveCase, dataDirReplaceColon, dataDirReplaceWhitespace, getName, getOSApplicationDataDir
-
Field Details
-
logger
protected final org.slf4j.Logger logger -
whitespaceReplacement
-
separatorReplacement
-
colonReplacement
-
-
Constructor Details
-
AbstractPlatform
public AbstractPlatform()
-
-
Method Details
-
getUserHome
Description copied from interface:PlatformReturns the directory for the current user.- Specified by:
getUserHomein interfacePlatform- Returns:
- the current user home directory
-
getApplicationDataDir
Description copied from interface:PlatformReturns the directory in which Aduna applications can store their application-dependent data, returns 'getOSApplicationDataDir' unless the system property "aduna.platform.applicationdata.dir" has been set.- Specified by:
getApplicationDataDirin interfacePlatform- Returns:
- the Aduna-specific application data directory
-
getApplicationDataDir
Description copied from interface:PlatformReturns the directory in which a specific application can store all its application-dependent data. This will be a sub-directory of the directory returned by the no-argument version of this method. Note: the directory might not exist yet.- Specified by:
getApplicationDataDirin interfacePlatform- Parameters:
applicationName- the name of the application for which to determine the directory- Returns:
- an application-specific data directory
- See Also:
-
getOSApplicationDataDir
Description copied from interface:PlatformReturns the operating system dependent application data directory. This will be a sub-directory of the directory returned by the no-argument version of this method.- Specified by:
getOSApplicationDataDirin interfacePlatform- Parameters:
applicationName- name of the application- Returns:
- application directory
-
getRelativeApplicationDataDir
Description copied from interface:PlatformGet the directory relative to getApplicationDataDir() for the specified application.- Specified by:
getRelativeApplicationDataDirin interfacePlatform- Parameters:
applicationName- the name of the application- Returns:
- the directory relative to getApplicationDataDir() for the specified application
-
getRelativeApplicationDataDir
public String getRelativeApplicationDataDir(String applicationName, boolean caseSensitive, boolean replaceWhitespace, boolean replaceColon) Get the relative name of the application directory- Parameters:
applicationName- name of the applicationcaseSensitive- true when case-sensitivereplaceWhitespace- true when whitespace is to be replacedreplaceColon- true when colon needs to be replaced- Returns:
- name of the application directory
-