public final class Settings extends Object
Modifier and Type | Field and Description |
---|---|
static String |
AUTO |
static String |
EDGE_USER_AGENT |
static String |
EWS |
static String |
GRAPH_URL |
static String |
O365 |
static String |
O365_INTERACTIVE |
static String |
O365_LOGIN_URL |
static String |
O365_MANUAL |
static String |
O365_MODERN |
static String |
O365_URL |
static String |
OUTLOOK_URL |
static String |
WEBDAV |
Modifier and Type | Method and Description |
---|---|
static boolean |
getBooleanProperty(String property)
Get a property value as boolean.
|
static boolean |
getBooleanProperty(String property,
boolean defaultValue)
Get a property value as boolean.
|
static char[] |
getCharArrayProperty(String property)
Get a property value as char[].
|
static String |
getGraphUrl()
Handle custom graph endpoints.
|
static int |
getIntProperty(String property)
Get a property value as int.
|
static int |
getIntProperty(String property,
int defaultValue)
Get a property value as int, return default value if null.
|
static String |
getLogFileDirectory()
Return DavMail log file directory
|
static String |
getLogFilePath()
Return DavMail log file path
|
static org.apache.log4j.Level |
getLoggingLevel(String category)
Return Log4J logging level for the category.
|
static String |
getO365LoginUrl() |
static String |
getO365Url() |
static String |
getOutlookUrl() |
static String |
getProperty(String property)
Get a property value as String.
|
static String |
getProperty(String property,
String defaultValue)
Get property value or default.
|
static Properties |
getSubProperties(String scope)
Get all properties that are in the specified scope, that is, that start with '<scope>.'.
|
static String |
getUserAgent() |
static boolean |
isFirstStart()
Detect first launch (properties file does not exist).
|
static boolean |
isLinux()
Test if running on Linux
|
static boolean |
isUnix() |
static boolean |
isWindows()
Test if running on Windows
|
static void |
load()
Load properties from current file path (command line or default).
|
static void |
load(InputStream inputStream)
Load properties from provided stream (used in webapp mode).
|
static String |
loadRefreshToken(String username) |
static void |
save()
Save settings in current file path (command line or default).
|
static void |
saveProperty(String property,
String value)
Change and save a single property.
|
static void |
setConfigFilePath(String path)
Set config file path (from command line parameter).
|
static void |
setDefaultSettings()
Set all settings to default values.
|
static void |
setLoggingLevel(String category,
org.apache.log4j.Level level)
Set Log4J logging level for the category
|
static void |
setProperty(String property,
String value)
Set a property value.
|
static void |
storeRefreshToken(String username,
String refreshToken) |
static void |
updateLoggingConfig()
Update Log4J config from settings.
|
public static final String OUTLOOK_URL
public static final String O365_URL
public static final String GRAPH_URL
public static final String O365_LOGIN_URL
public static final String O365
public static final String O365_MODERN
public static final String O365_INTERACTIVE
public static final String O365_MANUAL
public static final String WEBDAV
public static final String EWS
public static final String AUTO
public static final String EDGE_USER_AGENT
public static void setConfigFilePath(String path)
path
- davmail properties file pathpublic static boolean isFirstStart()
public static void load(InputStream inputStream) throws IOException
inputStream
- properties streamIOException
- on errorpublic static void load()
public static void setDefaultSettings()
public static String getLogFilePath()
public static String getLogFileDirectory()
public static void updateLoggingConfig()
public static void save()
public static String getProperty(String property)
property
- property namepublic static String getProperty(String property, String defaultValue)
property
- property namedefaultValue
- default property valuepublic static char[] getCharArrayProperty(String property)
property
- property namepublic static void setProperty(String property, String value)
property
- property namevalue
- property valuepublic static int getIntProperty(String property)
property
- property namepublic static int getIntProperty(String property, int defaultValue)
property
- property namedefaultValue
- default property valuepublic static boolean getBooleanProperty(String property)
property
- property namepublic static boolean getBooleanProperty(String property, boolean defaultValue)
property
- property namedefaultValue
- default property valuepublic static org.apache.log4j.Level getLoggingLevel(String category)
category
- logging categorypublic static Properties getSubProperties(String scope)
scope
- start of property namepublic static void setLoggingLevel(String category, org.apache.log4j.Level level)
category
- logging categorylevel
- logging levelpublic static void saveProperty(String property, String value)
property
- property namevalue
- property valuepublic static boolean isWindows()
public static boolean isLinux()
public static boolean isUnix()
public static String getUserAgent()
public static String getOutlookUrl()
public static String getO365Url()
public static String getGraphUrl()
public static String getO365LoginUrl()
Copyright © 2001–2025 MickaĆ«l Guessant. All rights reserved.