class DefaultOfferResource extends ApplicationStatusResource {

    @PUT
    @Path("/bulk/objects/{type}")
    @Consumes(MediaType.APPLICATION_OCTET_STREAM)
    @Produces(MediaType.APPLICATION_JSON)
    public Response bulkPutObjects(@PathParam("type") DataCategory type,
        @Context HttpHeaders headers, InputStream input) {

        final String xTenantId = headers.getHeaderString(GlobalDataRest.X_TENANT_ID);
        if (Strings.isNullOrEmpty(xTenantId)) {
            LOGGER.error(MISSING_THE_TENANT_ID_X_TENANT_ID);
            return Response.status(Response.Status.BAD_REQUEST).build();
        }
        final String containerName = buildContainerName(type, xTenantId);

        final String size = headers.getHeaderString(GlobalDataRest.VITAM_CONTENT_LENGTH);
        Long inputStreamSize;
        try {
            inputStreamSize = Long.valueOf(size);
        } catch (NumberFormatException e) {
            LOGGER.error("Bad or missing size '" + size + "'");
            return Response.status(Response.Status.BAD_REQUEST).build();
        }

        try {
            MultiplexedStreamReader multiplexedStreamReader = new MultiplexedStreamReader(
                new ExactSizeInputStream(input, inputStreamSize));

            Optional<ExactSizeInputStream> headerEntry = multiplexedStreamReader.readNextEntry();
            if (!headerEntry.isPresent()) {
                throw new IllegalStateException("Header entry not found");
            }
            List<String> objectIds = JsonHandler.getFromInputStream(headerEntry.get(), List.class);

            String xDigestAlgorithm = headers.getHeaderString(GlobalDataRest.X_DIGEST_ALGORITHM);
            if (StringUtils.isEmpty(xDigestAlgorithm)) {
                LOGGER.error("Missing digest");
                return Response.status(Response.Status.BAD_REQUEST).build();
            }
            DigestType digestType = DigestType.fromValue(xDigestAlgorithm);

            StorageBulkPutResult storageBulkPutResult = defaultOfferService
                .bulkPutObjects(containerName, objectIds, multiplexedStreamReader, type, digestType);

            return Response.status(Status.CREATED).entity(storageBulkPutResult).build();

        } catch (NonUpdatableContentAddressableStorageException e) {
            LOGGER.error("Object overriding forbidden", e);
            return Response.status(Status.CONFLICT).build();
        } catch (Exception exc) {
            LOGGER.error("Cannot create object", exc);
            return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
        } finally {
            StreamUtils.closeSilently(input);
        }
    }

    public  DefaultOfferResource(DefaultOfferService defaultOfferService);

}