private void handleProperty()

in src/main/java/org/apache/easyant/core/services/DefaultPluginService.java [360:402]


    private void handleProperty(Property property, EasyAntReport eaReport) throws IOException {
        boolean isCurrentModule = isCurrentModule(property.getProject(), property.getLocation());
        if (property.getFile() != null) {
            Properties propToLoad = new Properties();
            File f = property.getFile();
            if (f.exists()) {
                FileInputStream fis = null;

                try {
                    fis = new FileInputStream(f);
                    propToLoad.load(fis);
                    for (Object o : propToLoad.keySet()) {
                        String key = (String) o;
                        PropertyDescriptor propertyDescriptor = new PropertyDescriptor(key);
                        propertyDescriptor.setValue(propToLoad.getProperty(key));
                        if (property.getOwningTarget() != null) {
                            propertyDescriptor.setOwningTarget(property.getOwningTarget().getName());
                        }
                        eaReport.addPropertyDescriptor(propertyDescriptor.getName(), propertyDescriptor,
                                isCurrentModule);
                    }

                } catch (IOException e) {
                    IOException ioe = new IOException("Unable to parse the property file :" + property.getFile());
                    ioe.initCause(e);
                    throw ioe;
                } finally {
                    if (fis != null) {
                        fis.close();
                    }
                }
            }

        }
        if (property.getName() != null) {
            PropertyDescriptor propertyDescriptor = new PropertyDescriptor(property.getName());
            propertyDescriptor.setValue(property.getValue());
            if (property.getOwningTarget() != null) {
                propertyDescriptor.setOwningTarget(property.getOwningTarget().getName());
            }
            eaReport.addPropertyDescriptor(property.getName(), propertyDescriptor, isCurrentModule);
        }
    }