Package core.support.configReader
Class PropertiesReader
java.lang.Object
core.support.configReader.PropertiesReader
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllFiles(File curDir) getFileList(File curDir, ArrayList<String> array) gets all files in a directory to get all files: File curDir = new File("."); getAllFiles(curDir);static Stringstatic List<Properties> 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 booleanstatic List<Properties>
-
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 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
- 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
-