Package core.support.configReader
Class PropertiesReader
java.lang.Object
core.support.configReader.PropertiesReader
public class PropertiesReader extends Object
-
Field Summary
Fields Modifier and Type Field Description static StringLOCAL_ROOT_PATHstatic StringPROPERTIES_TYPE_CONFstatic StringPROPERTIES_TYPE_PROPERTIESstatic StringPROPERTIES_TYPE_PROPERTIES_TYPE2 -
Constructor Summary
Constructors Constructor Description PropertiesReader() -
Method Summary
Modifier and Type Method Description static ArrayList<String>getAllFiles(File curDir)static ArrayList<String>getFileList(File curDir, ArrayList<String> array)gets all files in a directory to get all files: File curDir = new File("."); getAllFiles(curDir);static StringgetLocalResourcePath()static List<Properties>getPropertiesByFileType(String path)static List<Properties>getPropertiesByFileType(String path, String fileType)gets all properties file by file type in a directorystatic StringgetPropertyPath(String path)recognized config file as a property file.static StringgetStringProperty(String key, Properties Property)gets the value of the properties file based on key value, And sets default value if value is missingstatic booleanisUsingCloud()static List<Properties>Property(String path)
-
Field Details
-
LOCAL_ROOT_PATH
-
PROPERTIES_TYPE_PROPERTIES
-
PROPERTIES_TYPE_PROPERTIES_TYPE2
-
PROPERTIES_TYPE_CONF
-
-
Constructor Details
-
PropertiesReader
public PropertiesReader()
-
-
Method Details
-
Property
- Parameters:
path- path to properties file- Returns:
- properties list of properties from properties file
- Throws:
Exception- exception from getting properties file
-
getPropertyPath
recognized config file as a property file. eg. /qa becomes /qa.property- Parameters:
path-- Returns:
-
getPropertiesByFileType
public static List<Properties> getPropertiesByFileType(String path, String fileType) throws Exceptiongets all properties file by file type in a directory- Parameters:
path- : directory pathfileType- : eg. ".conf"- Returns:
- list of all properties
- Throws:
Exception- exception from getting properties file
-
getPropertiesByFileType
- Throws:
Exception
-
getLocalResourcePath
- Returns:
- root path
-
isUsingCloud
public static boolean isUsingCloud()- Returns:
- is using app center
-
getStringProperty
gets the value of the properties file based on key value, And sets default value if value is missing- Parameters:
key- key in properties fileProperty- target properties from property file- Returns:
- string value of the property
-
getAllFiles
-
getFileList
gets all files in a directory to get all files: File curDir = new File("."); getAllFiles(curDir);- Parameters:
curDir- target directory- Returns:
- the list of all files in given directory
-