Package org.appng.core.service
Class PlatformProperties
- java.lang.Object
-
- org.appng.core.service.PlatformProperties
-
- All Implemented Interfaces:
Properties
public class PlatformProperties extends Object implements Properties
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PlatformProperties
get(Environment env)
static PlatformProperties
get(Properties platformConfig)
File
getApplicationDir()
byte[]
getBlob(String name)
Returns the byte-value of the givenProperty
.Boolean
getBoolean(String name)
Boolean
getBoolean(String name, Boolean defaultValue)
InputStream
getCacheConfig()
String
getClob(String name)
Returns the string-value of the givenProperty
.String
getClob(String name, String defaultValue)
Returns the string-value of the givenProperty
(if existing), or the default-value.String
getDescriptionFor(String name)
Returns the description for theProperty
with the given name, if anyDouble
getDouble(String name)
Double
getDouble(String name, Double defaultValue)
Float
getFloat(String name)
Float
getFloat(String name, Float defaultValue)
Integer
getInteger(String name)
Integer
getInteger(String name, Integer defaultValue)
List<String>
getList(String name, String delimiter)
List<String>
getList(String name, String defaultValue, String delimiter)
Properties
getPlainProperties()
Takes thisProperties
and transforms it into some (plain, old, uncool)Properties
.Properties
getProperties(String name)
Returns someProperties
parsed from the givenProperty
(if existing).Set<String>
getPropertyNames()
Returns allProperty
names.File
getRepositoryRootFolder()
String
getString(String name)
Returns the string-value of the givenProperty
.String
getString(String name, String defaultValue)
Returns the string-value of the givenProperty
(if existing), or the default-value.File
getUploadDir()
boolean
propertyExists(String name)
Checks whether theProperty
with the given name exists.
-
-
-
Method Detail
-
get
public static PlatformProperties get(Environment env)
-
get
public static PlatformProperties get(Properties platformConfig)
-
getList
public List<String> getList(String name, String defaultValue, String delimiter)
Description copied from interface:Properties
Returns aList
ofString
s which is parsed from the value of theProperty
with the given name (if present) or from the default-value.- Specified by:
getList
in interfaceProperties
- Parameters:
name
- the name of theProperty
defaultValue
- the default-string to parse the list fromdelimiter
- the delimiter to split the (default-)value by- Returns:
- a (possibly empty)
List
, nevernull
-
getList
public List<String> getList(String name, String delimiter)
Description copied from interface:Properties
-
getString
public String getString(String name)
Description copied from interface:Properties
Returns the string-value of the givenProperty
.- Specified by:
getString
in interfaceProperties
- Parameters:
name
- the name of theProperty
- Returns:
- the string-value of the given
Property
, ornull
if no such property exists.
-
getString
public String getString(String name, String defaultValue)
Description copied from interface:Properties
Returns the string-value of the givenProperty
(if existing), or the default-value.- Specified by:
getString
in interfaceProperties
- Parameters:
name
- the name of theProperty
defaultValue
- the default-value- Returns:
- the string-value of the given
Property
(if existing), or the default-value
-
getBoolean
public Boolean getBoolean(String name)
Description copied from interface:Properties
- Specified by:
getBoolean
in interfaceProperties
- Parameters:
name
- the name of theProperty
- Returns:
- a
Boolean
, ornull
if no suchProperty
exists.
-
getBoolean
public Boolean getBoolean(String name, Boolean defaultValue)
- Specified by:
getBoolean
in interfaceProperties
- Parameters:
name
- the name of theProperty
defaultValue
- the default-value- Returns:
- a
Boolean
, or the default-value if no suchProperty
exists.
-
getInteger
public Integer getInteger(String name)
Description copied from interface:Properties
- Specified by:
getInteger
in interfaceProperties
- Parameters:
name
- the name of theProperty
- Returns:
- an
Integer
, ornull
if no suchProperty
exists.
-
getInteger
public Integer getInteger(String name, Integer defaultValue)
Description copied from interface:Properties
- Specified by:
getInteger
in interfaceProperties
- Parameters:
name
- the name of theProperty
defaultValue
- the default-value- Returns:
- an
Integer
, or the default-value if no suchProperty
exists.
-
getFloat
public Float getFloat(String name)
Description copied from interface:Properties
- Specified by:
getFloat
in interfaceProperties
- Parameters:
name
- the name of theProperty
- Returns:
- an
Float
, ornull
if no suchProperty
exists.
-
getFloat
public Float getFloat(String name, Float defaultValue)
Description copied from interface:Properties
- Specified by:
getFloat
in interfaceProperties
- Parameters:
name
- the name of theProperty
defaultValue
- the default-value- Returns:
- an
Float
, or the default-value if no suchProperty
exists.
-
getDouble
public Double getDouble(String name)
Description copied from interface:Properties
- Specified by:
getDouble
in interfaceProperties
- Parameters:
name
- the name of theProperty
- Returns:
- an
Double
, ornull
if no suchProperty
exists.
-
getDouble
public Double getDouble(String name, Double defaultValue)
Description copied from interface:Properties
- Specified by:
getDouble
in interfaceProperties
- Parameters:
name
- the name of theProperty
defaultValue
- the default-value- Returns:
- a
Double
, or the default-value if no suchProperty
exists.
-
getClob
public String getClob(String name)
Description copied from interface:Properties
Returns the string-value of the givenProperty
.- Specified by:
getClob
in interfaceProperties
- Parameters:
name
- the name of theProperty
- Returns:
- the string-value of the given
Property
, ornull
if no suchProperty
exists.
-
getClob
public String getClob(String name, String defaultValue)
Description copied from interface:Properties
Returns the string-value of the givenProperty
(if existing), or the default-value.- Specified by:
getClob
in interfaceProperties
- Parameters:
name
- the name of theProperty
defaultValue
- the default-value- Returns:
- the string-value of the given
Property
(if existing), or the default-value
-
getBlob
public byte[] getBlob(String name)
Description copied from interface:Properties
Returns the byte-value of the givenProperty
.- Specified by:
getBlob
in interfaceProperties
- Parameters:
name
- the name of theProperty
- Returns:
- the byte-value of the given
Property
, ornull
if no suchProperty
exists.
-
getPropertyNames
public Set<String> getPropertyNames()
Description copied from interface:Properties
Returns allProperty
names.- Specified by:
getPropertyNames
in interfaceProperties
- Returns:
- all
Property
names
-
propertyExists
public boolean propertyExists(String name)
Description copied from interface:Properties
Checks whether theProperty
with the given name exists.- Specified by:
propertyExists
in interfaceProperties
- Parameters:
name
- the name of theProperty
- Returns:
true
if theProperty
exists,false
otherwise
-
getPlainProperties
public Properties getPlainProperties()
Description copied from interface:Properties
Takes thisProperties
and transforms it into some (plain, old, uncool)Properties
.- Specified by:
getPlainProperties
in interfaceProperties
- Returns:
- some
Properties
-
getProperties
public Properties getProperties(String name)
Description copied from interface:Properties
Returns someProperties
parsed from the givenProperty
(if existing).- Specified by:
getProperties
in interfaceProperties
- Parameters:
name
- the name of theProperty
- Returns:
- some
Properties
, ornull
if no suchProperty
exists.
-
getDescriptionFor
public String getDescriptionFor(String name)
Description copied from interface:Properties
Returns the description for theProperty
with the given name, if any- Specified by:
getDescriptionFor
in interfaceProperties
- Parameters:
name
- the name of the property- Returns:
- the description, if any
-
getCacheConfig
public InputStream getCacheConfig() throws IOException
- Throws:
IOException
-
getUploadDir
public File getUploadDir()
-
getApplicationDir
public File getApplicationDir()
-
getRepositoryRootFolder
public File getRepositoryRootFolder()
-
-