Package org.openbravo.base.provider
Class OBConfigFileProvider
- java.lang.Object
-
- org.openbravo.base.provider.OBConfigFileProvider
-
- All Implemented Interfaces:
OBProvidable
,OBSingleton
public class OBConfigFileProvider extends Object implements OBSingleton
Is used to read config files from specific locations and initialize the OBProvider.- Author:
- Martin Taal
-
-
Constructor Summary
Constructors Constructor Description OBConfigFileProvider()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getClassPathLocation()
String
getFileLocation()
static OBConfigFileProvider
getInstance()
protected InputStream
getResourceAsStream(String path)
javax.servlet.ServletContext
getServletContext()
protected void
readModuleConfigsFromClassPath()
protected void
readModuleConfigsFromFile()
void
setClassPathLocation(String classPathLocation)
void
setConfigInProvider()
This method will read the ob-provider config files (with bean specifications) and pass them to theOBProvider
.void
setFileLocation(String fileLocation)
static void
setInstance(OBConfigFileProvider instance)
void
setServletContext(javax.servlet.ServletContext servletContext)
-
-
-
Method Detail
-
getInstance
public static OBConfigFileProvider getInstance()
-
setInstance
public static void setInstance(OBConfigFileProvider instance)
-
getFileLocation
public String getFileLocation()
- Returns:
- the directory containing the Openbravo.properties file, so not the full path including the filename (Openbravo.properties) but the path to and including the directory.
-
setFileLocation
public void setFileLocation(String fileLocation)
- Parameters:
fileLocation
- the path to the directory which contains the openbravo properties file (Openbravo.properties). The path does not include the Openbravo.properties file itself.- See Also:
getFileLocation()
-
getClassPathLocation
public String getClassPathLocation()
-
setClassPathLocation
public void setClassPathLocation(String classPathLocation)
-
setConfigInProvider
public void setConfigInProvider()
This method will read the ob-provider config files (with bean specifications) and pass them to theOBProvider
. It reads the file from the class path or from a file location. Depending on what is set:getClassPathLocation()
and/orgetFileLocation()
.
-
readModuleConfigsFromFile
protected void readModuleConfigsFromFile()
-
readModuleConfigsFromClassPath
protected void readModuleConfigsFromClassPath()
-
getResourceAsStream
protected InputStream getResourceAsStream(String path)
-
getServletContext
public javax.servlet.ServletContext getServletContext()
-
setServletContext
public void setServletContext(javax.servlet.ServletContext servletContext)
-
-