![BlogImage.jpg](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg7yp-T68731EKjzD2gMMVqdBs3CKmb0h6pcH6199_QG7vHL07eaZA_AXNGik69I5uFN4R4vg2z4js6NvlSMM6cyF04bXHSOU-Qxslgpsr4hwPpaa2l_N2AnuG4C2AsL3mmW8sv0HMzhV0u6ufEbPM11HFWQTzqEykfNyUW97lHXI3ovOJJ8FdutJ3W0jE/w640-h250/postman-bulk-import-2.png)
Abstract
Kickoff Bulk Import from AEM
@Reference
private SlingRequestProcessor slingRequestProcessor;
@Reference
private RequestResponseFactory requestResponseFactory;
private static final String IMPORT_JOB_URL = "/conf/global/settings/dam/import/bulk-import-config-name.importJob.json";
private void runBulkImport(final ResourceResolver resolver){
final Map<String, Object> requestParams = new ConcurrentHashMap<>();
requestParams.put("operation", "run");
final HttpServletRequest request = requestResponseFactory.createRequest("POST", IMPORT_JOB_URL,
requestParams);
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
final HttpServletResponse response = this.requestResponseFactory.createResponse(bos);
try {
slingRequestProcessor.processRequest(request, response, resolver);
} catch (ServletException | IOException e) {
logger.error("Error while running bulk import ", e);
}
}
Read Full Blog
Q&A
Please use this thread to ask the related questions.