Package davmail
Class Settings
java.lang.Object
davmail.Settings
Settings facade.
DavMail settings are stored in the .davmail.properties file in current
user home directory or in the file specified on the command line.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionstatic booleangetBooleanProperty(String property) Get a property value as boolean.static booleangetBooleanProperty(String property, boolean defaultValue) Get a property value as boolean.static char[]getCharArrayProperty(String property) Get a property value as char[].static StringSet davmail properties path in Docker and Flatpakstatic StringHandle custom graph endpoints.static intgetIntProperty(String property) Get a property value as int.static intgetIntProperty(String property, int defaultValue) Get a property value as int, return default value if null.static StringReturn DavMail log file directorystatic StringReturn DavMail log file pathstatic org.apache.log4j.LevelgetLoggingLevel(String category) Return Log4J logging level for the category.static Stringstatic Stringstatic Stringstatic Stringstatic StringgetProperty(String property) Get a property value as String.static StringgetProperty(String property, String defaultValue) Get property value or default.static PropertiesgetSubProperties(String scope) Get all properties that are in the specified scope, that is, that start with '<scope>.'.static Stringstatic booleanisDocker()static booleanDetect first launch (properties file does not exist).static booleanstatic booleanstatic booleanstatic booleanisLinux()Test if running on Linuxstatic booleanisOSX()Test if running on OSXstatic booleanstatic booleanisUnix()static booleanTest if running on Windowsstatic voidload()Load properties from current file path (command line or default).static voidload(InputStream inputStream) Load properties from provided stream (used in webapp mode).static StringloadRefreshToken(String username) static voidsave()Save settings in current file path (command line or default).static voidsaveProperty(String property, String value) Change and save a single property.static voidsetConfigFilePath(String path) Set config file path (from command line parameter).static voidSet all settings to default values.static voidsetLoggingLevel(String category, org.apache.log4j.Level level) Set Log4J logging level for the categorystatic voidsetProperty(String property, String value) Set a property value.static voidstoreRefreshToken(String username, String refreshToken) static voidUpdate Log4J config from settings.
-
Field Details
-
OUTLOOK_URL
- See Also:
-
O365_URL
- See Also:
-
GRAPH_URL
- See Also:
-
O365_LOGIN_URL
- See Also:
-
O365_EWS
- See Also:
-
O365_GRAPH
- See Also:
-
EXCHANGE_EWS
- See Also:
-
EXCHANGE_WEBDAV
- See Also:
-
O365_INTERACTIVE
- See Also:
-
O365_MANUAL
- See Also:
-
O365_DEVICECODE
- See Also:
-
O365_TRANSPARENT
- See Also:
-
O365_MODERN
- See Also:
-
O365
- See Also:
-
WEBDAV
- See Also:
-
EWS
- See Also:
-
AUTO
- See Also:
-
EDGE_USER_AGENT
- See Also:
-
-
Method Details
-
setConfigFilePath
Set config file path (from command line parameter).- Parameters:
path- davmail properties file path
-
isFirstStart
public static boolean isFirstStart()Detect first launch (properties file does not exist).- Returns:
- true if this is the first start with the current file path
-
load
Load properties from provided stream (used in webapp mode).- Parameters:
inputStream- properties stream- Throws:
IOException- on error
-
load
public static void load()Load properties from current file path (command line or default). -
setDefaultSettings
public static void setDefaultSettings()Set all settings to default values. Ports above 1024 for unix/linux -
getLogFilePath
Return DavMail log file path- Returns:
- full log file path
-
getLogFileDirectory
Return DavMail log file directory- Returns:
- full log file directory
-
updateLoggingConfig
public static void updateLoggingConfig()Update Log4J config from settings. -
save
public static void save()Save settings in current file path (command line or default). -
getProperty
Get a property value as String.- Parameters:
property- property name- Returns:
- property value
-
getProperty
Get property value or default.- Parameters:
property- property namedefaultValue- default property value- Returns:
- property value
-
getCharArrayProperty
Get a property value as char[].- Parameters:
property- property name- Returns:
- property value
-
setProperty
Set a property value.- Parameters:
property- property namevalue- property value
-
getIntProperty
Get a property value as int.- Parameters:
property- property name- Returns:
- property value
-
getIntProperty
Get a property value as int, return default value if null.- Parameters:
property- property namedefaultValue- default property value- Returns:
- property value
-
getBooleanProperty
Get a property value as boolean.- Parameters:
property- property name- Returns:
- property value
-
getBooleanProperty
Get a property value as boolean.- Parameters:
property- property namedefaultValue- default property value- Returns:
- property value
-
loadRefreshToken
-
storeRefreshToken
-
getLoggingLevel
Return Log4J logging level for the category.- Parameters:
category- logging category- Returns:
- logging level
-
getSubProperties
Get all properties that are in the specified scope, that is, that start with '<scope>.'.- Parameters:
scope- start of property name- Returns:
- properties
-
setLoggingLevel
Set Log4J logging level for the category- Parameters:
category- logging categorylevel- logging level
-
saveProperty
Change and save a single property.- Parameters:
property- property namevalue- property value
-
isWindows
public static boolean isWindows()Test if running on Windows- Returns:
- true on Windows
-
isOSX
public static boolean isOSX()Test if running on OSX- Returns:
- true on Mac OS X
-
isLinux
public static boolean isLinux()Test if running on Linux- Returns:
- true on Linux
-
isUnix
public static boolean isUnix() -
getUserAgent
-
getOutlookUrl
-
getO365Url
-
getGraphUrl
Handle custom graph endpoints. See ...- Returns:
- graph endpoint url
-
getO365LoginUrl
-
getOauthScope
-
isGraphEnabled
public static boolean isGraphEnabled() -
isSWTAvailable
public static boolean isSWTAvailable() -
isJFXAvailable
public static boolean isJFXAvailable() -
isDocker
public static boolean isDocker() -
isFlatpak
public static boolean isFlatpak() -
getConfigFilePath
Set davmail properties path in Docker and Flatpak- Returns:
- davmail.properties path
-