Subversion Repositories SmartDukaan

Rev

Rev 30395 | Rev 30567 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 30395 Rev 30566
Line 122... Line 122...
122
					final InputStreamResource inputStreamResource = new InputStreamResource(inputStream);
122
					final InputStreamResource inputStreamResource = new InputStreamResource(inputStream);
123
					LOGGER.info("Before stream - {}", pdfModels);
123
					LOGGER.info("Before stream - {}", pdfModels);
124
					return new ResponseEntity<>(inputStreamResource, headers, HttpStatus.OK);*/
124
					return new ResponseEntity<>(inputStreamResource, headers, HttpStatus.OK);*/
125
				} else {
125
				} else {
126
					Map<String, String> headersMap = new HashMap<>();
126
					Map<String, String> headersMap = new HashMap<>();
127
					headersMap.put("Authorization", "Basic " + Base64.getEncoder().encodeToString("sd:smart@123".getBytes()));
127
					headersMap.put("Authorization", "Basic " + Base64.getEncoder().encodeToString("smartdukaan:$smart@123#".getBytes()));
128
					if (invoiceNumbers.size() == 1) {
128
					if (invoiceNumbers.size() == 1) {
129
						String invoicePath = this.getInvoicePath(invoiceOrdersMap.get(invoiceNumbers.get(0)).get(0));
129
						String invoicePath = this.getInvoicePath(invoiceOrdersMap.get(invoiceNumbers.get(0)).get(0));
130
						HttpResponse response = restClient.getResponse("http://50.116.3.101/" + invoicePath, null, headersMap);
130
						HttpResponse response = restClient.getResponse("http://50.116.3.101/" + invoicePath, null, headersMap);
131
						InputStreamResource is = new InputStreamResource(response.getEntity().getContent());
131
						InputStreamResource is = new InputStreamResource(response.getEntity().getContent());
132
						return new ResponseEntity<>(is, headers, HttpStatus.OK);
132
						return new ResponseEntity<>(is, headers, HttpStatus.OK);