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
All Methods Static Methods Concrete Methods 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)
-
-
-
Method Detail
-
Property
public static List<Properties> Property(String path) throws Exception
- Parameters:
path- path to properties file- Returns:
- properties list of properties from properties file
- Throws:
Exception- exception from getting properties file
-
getPropertyPath
public static String getPropertyPath(String path)
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 Exception
gets 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
public static List<Properties> getPropertiesByFileType(String path) throws Exception
- Throws:
Exception
-
getLocalResourcePath
public static String getLocalResourcePath()
- Returns:
- root path
-
isUsingCloud
public static boolean isUsingCloud()
- Returns:
- is using app center
-
getStringProperty
public static String getStringProperty(String key, Properties Property)
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
-
-