Class ItemImportController

java.lang.Object
com.hybris.datahub.core.rest.controllers.ItemImportController

@Controller @RequestMapping("/import/") public class ItemImportController extends Object
A REST resource for uploading and executing IMPEX files.
  • Constructor Details

    • ItemImportController

      public ItemImportController()
  • Method Details

    • importFromStream

      @RequestMapping(value="/pools/{poolName}/publications/{publicationId}", method=PUT, consumes="application/octet-stream", produces={"application/json","application/xml"}) @ResponseStatus(OK) public void importFromStream(@PathVariable("poolName") String poolName, @PathVariable("publicationId") Long publicationId, @RequestHeader("Result-Callback-URL") String resultCallbackUrl, InputStream inputStream) throws IOException
      Performs upload of an ImpEx file and import of the items containing in the file.
      Parameters:
      poolName - pool whose items are being imported
      publicationId - the publicationId
      resultCallbackUrl - the callback URL to use when returning the ItemImportResult
      inputStream - input stream to the impex script
      Throws:
      IOException
    • inputStreamToByteArray

      protected byte[] inputStreamToByteArray(InputStream inputStream) throws IOException
      Throws:
      IOException