fr.paris.lutece.portal.service.util
Class AppPropertiesService

java.lang.Object
  extended by fr.paris.lutece.portal.service.util.AppPropertiesService

public final class AppPropertiesService
extends java.lang.Object

this class provides management services for properties files


Method Summary
static java.util.List<java.lang.String> getKeys(java.lang.String strPrefix)
          Returns a list of keys that match a given prefix
static java.util.Properties getProperties()
          Gets properties
static java.lang.String getProperty(java.lang.String strProperty)
          Returns the value of a variable defined in the .properties file of the application as a String
static java.lang.String getProperty(java.lang.String strProperty, java.lang.String strDefault)
          Returns the value of a variable defined in the .properties file of the application as a String
static boolean getPropertyBoolean(java.lang.String strProperty, boolean bDefault)
          Returns the value of a variable defined in the .properties file of the application as a boolean
static int getPropertyInt(java.lang.String strProperty, int nDefault)
          Returns the value of a variable defined in the .properties file of the application as an int
static long getPropertyLong(java.lang.String strProperty, long lDefault)
          Returns the value of a variable defined in the .properties file of the application as an long
static void init(java.lang.String strConfPath)
          Initializes the service
static void reload(java.lang.String strFilename)
          Reloads a given properties file
static void reloadAll()
          Reloads all the properties files
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public static void init(java.lang.String strConfPath)
                 throws LuteceInitException
Initializes the service

Parameters:
strConfPath - The configuration path
Throws:
LuteceInitException - If an error occured

getProperty

public static java.lang.String getProperty(java.lang.String strProperty)
Returns the value of a variable defined in the .properties file of the application as a String

Parameters:
strProperty - The variable name
Returns:
The variable value read in the properties file

getProperty

public static java.lang.String getProperty(java.lang.String strProperty,
                                           java.lang.String strDefault)
Returns the value of a variable defined in the .properties file of the application as a String

Parameters:
strProperty - The variable name
strDefault - The default value which is returned if no value is found for the variable in the .properties file.
Returns:
The variable value read in the properties file

getPropertyInt

public static int getPropertyInt(java.lang.String strProperty,
                                 int nDefault)
Returns the value of a variable defined in the .properties file of the application as an int

Parameters:
strProperty - The variable name
nDefault - The default value which is returned if no value is found for the variable in the le downloadFile .properties. .properties file.
Returns:
The variable value read in the properties file

getPropertyLong

public static long getPropertyLong(java.lang.String strProperty,
                                   long lDefault)
Returns the value of a variable defined in the .properties file of the application as an long

Parameters:
strProperty - The variable name
lDefault - The default value which is returned if no value is found for the variable in the le downloadFile .properties. .properties file.
Returns:
The variable value read in the properties file

getPropertyBoolean

public static boolean getPropertyBoolean(java.lang.String strProperty,
                                         boolean bDefault)
Returns the value of a variable defined in the .properties file of the application as a boolean

Parameters:
strProperty - The variable name
bDefault - The default value which is returned if no value is found for the variable in the le downloadFile .properties. .properties file.
Returns:
The variable value read in the properties file

reloadAll

public static void reloadAll()
Reloads all the properties files


reload

public static void reload(java.lang.String strFilename)
Reloads a given properties file

Parameters:
strFilename - The file name

getProperties

public static java.util.Properties getProperties()
Gets properties

Returns:
All properties
Since:
version 3.0

getKeys

public static java.util.List<java.lang.String> getKeys(java.lang.String strPrefix)
Returns a list of keys that match a given prefix

Parameters:
strPrefix -
Returns:
A list of keys that match the prefix
Since:
version 3.0


Copyright © 2012 Mairie de Paris. All Rights Reserved.