Class PropertiesReader

java.lang.Object
core.support.configReader.PropertiesReader

public class PropertiesReader
extends Object
  • Field Details

    • LOCAL_ROOT_PATH

      public static String LOCAL_ROOT_PATH
    • PROPERTIES_TYPE_PROPERTIES

      public static String PROPERTIES_TYPE_PROPERTIES
    • PROPERTIES_TYPE_PROPERTIES_TYPE2

      public static String PROPERTIES_TYPE_PROPERTIES_TYPE2
    • PROPERTIES_TYPE_CONF

      public static String PROPERTIES_TYPE_CONF
  • Constructor Details

    • PropertiesReader

      public PropertiesReader()
  • Method Details

    • 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 path
      fileType - : 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 file
      Property - target properties from property file
      Returns:
      string value of the property
    • getAllFiles

      public static ArrayList<String> getAllFiles​(File curDir)
    • getFileList

      public 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);
      Parameters:
      curDir - target directory
      Returns:
      the list of all files in given directory