public class Configuration extends Object
It contains the following parameters:
nullhttp://recorder.samebug.io| Constructor and Description |
|---|
Configuration(String appKey)
Construct a configuration with the specified application key.
|
| Modifier and Type | Method and Description |
|---|---|
static Configuration |
fromDefault()
Factory method to create a configuration with the default values.
|
static Configuration |
fromProperties()
Factory method of the default configuration.
|
static Configuration |
fromPropertyFile(String fileName)
Factory method to create a configuration based on the content of a
property file, given with its absolute path.
|
static Configuration |
fromPropertyResource(String resourceName)
Factory method to create a configuration based on the content of a
resource property file.
|
UUID |
getAppKey() |
boolean |
getDebug() |
URL |
getServerURL() |
String |
getVersion() |
protected static InputStream |
openResource(String resourceName) |
void |
setDebug(String debug)
Set if samebug notifier should print debug messages.
|
void |
setServer(String serverAddress)
Set your samebug API endpoint.
|
void |
setVersion(String version)
Set your application version.
|
public Configuration(String appKey) throws BadAppKey
The other parameters are left on default.
appKey - the key of your registered Samebug application, as found on
the documentation site of your app. Must not be
nullBadAppKey - when appKey is not parseable as a UUIDpublic void setVersion(String version)
null means an unspecified version.
version - arbitrary stringpublic void setServer(String serverAddress) throws BadServerAddress
serverAddress - an URL string of a samebug serverBadServerAddress - when serverAddress is not a valid URLpublic void setDebug(String debug)
debug - "false" disables debug messages, any else string enables it.public UUID getAppKey()
public String getVersion()
public URL getServerURL()
public boolean getDebug()
public static Configuration fromProperties() throws NoConfigFileException, MultipleConfigFileException, BadAppKey, BadServerAddress
This method will build a configuration based on values taken from many location. Each value is assigned in this order:
NoConfigFileExceptionMultipleConfigFileExceptionBadAppKeyBadServerAddresspublic static Configuration fromDefault() throws NoConfigFileException, MultipleConfigFileException, BadAppKey, BadServerAddress
public static Configuration fromPropertyResource(String resourceName) throws NoConfigFileException, MultipleConfigFileException, BadServerAddress, BadAppKey
resourceName - the name of the resourceNoConfigFileExceptionMultipleConfigFileExceptionBadServerAddressBadAppKeypublic static Configuration fromPropertyFile(String fileName) throws NoConfigFileException, MultipleConfigFileException, BadServerAddress, BadAppKey
fileName - the name of the fileNoConfigFileExceptionMultipleConfigFileExceptionBadServerAddressBadAppKeyprotected static InputStream openResource(String resourceName) throws NoConfigFileException, MultipleConfigFileException, IOException
Copyright © 2014. All rights reserved.