Hello i have application that read data from properties file and put it in HashMap. This is for report data in jasper report.

I have 2 .properties files that hold the data for each report.
When I read the file and put it into Hashmap properties it is error, the data is truncated and not all legible. So It only generate 1 report the whole report, and for the second report it was empty.
But when there is only 1 .properties file , the data completely generated.

I think i was wrong in my HashMap , i very confused on it.

Here's my code:

Java Code:
public void pdfExport(String noMr, String path) {
        try {
            
            String parentPath = "data/"+noMr+"/reports";
            
            if (noMr != null) {
                // Export semua report menjadi pdf
                File patientFolder = new File(parentPath);
                File [] listOfFiles = patientFolder.listFiles();
                String files = null;
                
                String imageDefLoco = ReportController.iReportDir +"image-sample.jpg";
                FileInputStream imageDefault = new FileInputStream(imageDefLoco);
                                
                String template = null;
                String visitCodeProperties = null;
                                
                for (int i = 0; i < listOfFiles.length; i++) {
                    
                    if(listOfFiles[i].isFile()) {
                        files = listOfFiles[i].getName();
                        String newPath = parentPath+"/"+files;
                            Properties properties = new Properties();
                            //if (files.endsWith(".properties")) {
                            properties.load(new FileInputStream(newPath));
                            
                            template = properties.getProperty("template");
                            visitCodeProperties = properties.getProperty("visitCode");
                            visitCodeProperties = visitCodeProperties.replace("V-", "");
                            
                            HashMap param = new HashMap();
                            param.put("noMr", properties.getProperty("noMr"));
                            param.put("visitCode", properties.getProperty("visitCode"));
                            param.put("templateLoco", ReportController.iReportDir);
                            param.put("tools", properties.getProperty("alat"));
                            param.put("medicine", properties.getProperty("obat"));
                            param.put("result", properties.getProperty("hasil"));
                            param.put("conclusion", properties.getProperty("kesimpulan"));
                            param.put("suggestion", properties.getProperty("saran"));
                            
                            // Get imageX key from .properties file
                            Enumeration imageKeys = properties.propertyNames();
                            int countImageKeys = 0;

                                while (imageKeys.hasMoreElements()) {
                                    if (imageKeys.nextElement().toString().startsWith("image")) {
                                        countImageKeys++;
                                    }
                                }
                                
                                if (countImageKeys == 0) {
                                    for (int j = 0; j < 8; j++) {
                                        param.put("imgResult"+(j+1), imageDefault);
                                    }
                                } else {
                                    for (int j = 0; j < countImageKeys; j++) {
                                        //File fileImg = new File(properties.getProperty("image"+(j+1)));
                                        FileInputStream gambar = new FileInputStream("D:\\image_2013451167540555_1.jpg");
                                        param.put("imgResult"+(j+1), gambar);
                                    }
                                    
                                    if (countImageKeys < 8) {
                                        for (int j = countImageKeys; j < 8; j++) {
                                            param.put("imgResult"+(j+1), imageDefault);
                                        }
                                    }
                                    
                                    for (Object key : param.keySet()) {
                                            System.out.println("Key : " + key.toString() + " Value : "
                                                    + param.get(key));
                                    }
                                    
                                }
                                
                                try {
                                    JasperPrint jasperPrint = JasperFillManager.fillReport(template, param, DatabaseUtility.getConnection());

                                    // Export to PDF File
                                    String outputFile = path+"/"+noMr+"_MedicalData_"+visitCodeProperties+".pdf";
                                    JRExporter exporter = new JRPdfExporter();
                                    exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);
                                    exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, outputFile);
                                    exporter.exportReport();

                                } catch (Exception e) {
                                    e.printStackTrace();
                                }
                        //}
                        
                    }
                }
                
            }
        } catch (IOException ioe) {
            ioe.printStackTrace();
        }
      }

Please help,: (