// Path: components/registry/org.wso2.carbon.registry.resource/src/main/java/org/wso2/carbon/registry/resource/beans/PropertiesBean.java
// @SuppressWarnings({"EI_EXPOSE_REP", "EI_EXPOSE_REP2"})
// public class PropertiesBean {
//     private Property[] properties;
// 
//     public Property[] getProperties() {
//         return properties;
//     }
// 
//     public void setProperties(Property[] properties) {
//         this.properties = properties;
//     }
// }
// 
// Path: components/registry/org.wso2.carbon.registry.resource/src/main/java/org/wso2/carbon/registry/resource/beans/Property.java
// public class Property {
//     private String key;
//     private String value;
// 
//     public String getKey() {
//         return key;
//     }
// 
//     public void setKey(String key) {
//         this.key = key;
//     }
// 
//     public String getValue() {
//         return value;
//     }
// 
//     public void setValue(String value) {
//         this.value = value;
//     }
// }


import java.util.Properties;
import org.wso2.carbon.registry.core.session.UserRegistry;
import org.wso2.carbon.registry.core.Resource;
import org.wso2.carbon.registry.core.exceptions.RegistryException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.registry.resource.beans.PermissionEntry;
import org.wso2.carbon.registry.resource.beans.PropertiesBean;
import org.wso2.carbon.registry.resource.beans.Property;
import java.awt.*;
import java.sql.SQLException;
import java.util.ArrayList;

                if (resource != null) {
                    String value = resource.getProperty(key);
                    resource.discard();
                    return value;
                }
            }
            
        } catch (RegistryException e) {

            String msg = "Failed to get the resource information of resource " + resourcePath +
                    " for retrieving a property with key : " + key + ". Error :" +
                    ((e.getCause() instanceof SQLException) ?
                    "" : e.getMessage());
            log.error(msg, e);
            throw e;
        }

        return "";
    }

    public static PropertiesBean getProperties(UserRegistry registry, String resourcePath) throws RegistryException {

        try {
            if (registry.resourceExists(resourcePath)) {

                Resource resource = registry.get(resourcePath);
                if (resource != null) {
                    Properties props = resource.getProperties();
                    PropertiesBean propertiesBean = new PropertiesBean();


// Path: components/registry/org.wso2.carbon.registry.resource/src/main/java/org/wso2/carbon/registry/resource/beans/PropertiesBean.java
// @SuppressWarnings({"EI_EXPOSE_REP", "EI_EXPOSE_REP2"})
// public class PropertiesBean {
//     private Property[] properties;
// 
//     public Property[] getProperties() {
//         return properties;
//     }
// 
//     public void setProperties(Property[] properties) {
//         this.properties = properties;
//     }
// }
// 
// Path: components/registry/org.wso2.carbon.registry.resource/src/main/java/org/wso2/carbon/registry/resource/beans/Property.java
// public class Property {
//     private String key;
//     private String value;
// 
//     public String getKey() {
//         return key;
//     }
// 
//     public void setKey(String key) {
//         this.key = key;
//     }
// 
//     public String getValue() {
//         return value;
//     }
// 
//     public void setValue(String value) {
//         this.value = value;
//     }
// }


// Path: components/registry/org.wso2.carbon.registry.resource/src/main/java/org/wso2/carbon/registry/resource/services/utils/GetPropertyUtil.java
import java.util.Properties;
import org.wso2.carbon.registry.core.session.UserRegistry;
import org.wso2.carbon.registry.core.Resource;
import org.wso2.carbon.registry.core.exceptions.RegistryException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.registry.resource.beans.PermissionEntry;
import org.wso2.carbon.registry.resource.beans.PropertiesBean;
import org.wso2.carbon.registry.resource.beans.Property;
import java.awt.*;
import java.sql.SQLException;
import java.util.ArrayList;

                if (resource != null) {
                    String value = resource.getProperty(key);
                    resource.discard();
                    return value;
                }
            }
            
        } catch (RegistryException e) {

            String msg = "Failed to get the resource information of resource " + resourcePath +
                    " for retrieving a property with key : " + key + ". Error :" +
                    ((e.getCause() instanceof SQLException) ?
                    "" : e.getMessage());
            log.error(msg, e);
            throw e;
        }

        return "";
    }

    public static PropertiesBean getProperties(UserRegistry registry, String resourcePath) throws RegistryException {

        try {
            if (registry.resourceExists(resourcePath)) {

                Resource resource = registry.get(resourcePath);
                if (resource != null) {
                    Properties props = resource.getProperties();
                    PropertiesBean propertiesBean = new PropertiesBean();


                    java.util.List<Property> p = new ArrayList<>();
