class StorageResource extends ApplicationStatusResource implements VitamAutoCloseable {

    @Path(
        "/{type:UNIT|OBJECT|OBJECTGROUP|LOGBOOK|REPORT|MANIFEST|PROFILE|STORAGELOG|STORAGEACCESSLOG|STORAGETRACEABILITY|RULES|DIP|AGENCIES|BACKUP" +
            "|BACKUP_OPERATION|CHECKLOGBOOKREPORTS|OBJECTGROUP_GRAPH|UNIT_GRAPH|DISTRIBUTIONREPORTS|ACCESSION_REGISTER_DETAIL|ACCESSION_REGISTER_SYMBOLIC}")
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    @Consumes(MediaType.APPLICATION_JSON)
    public Response listObjects(@Context HttpHeaders headers, @PathParam("type") DataCategory type) {
        VitamCode vitamCode = checkTenantAndHeaders(headers, VitamHttpHeader.STRATEGY_ID);
        if (vitamCode != null) {
            return buildErrorResponse(vitamCode);
        }
        String strategyId;
        try {
            strategyId = HttpHeaderHelper.getHeaderValues(headers, VitamHttpHeader.STRATEGY_ID).get(0);
            CloseableIterator<ObjectEntry> objectEntryIterator = distribution.listContainerObjects(strategyId, type);

            StreamingOutput streamingOutput = output -> {
                try (
                    CloseShieldOutputStream closeShieldOutputStream = new CloseShieldOutputStream(output);
                    ObjectEntryWriter objectEntryWriter = new ObjectEntryWriter(closeShieldOutputStream)) {

                    while (objectEntryIterator.hasNext()) {
                        objectEntryWriter.write(objectEntryIterator.next());
                    }

                    // No errors ==> write EOF
                    objectEntryWriter.writeEof();

                } catch (Exception e) {
                    String msg = "Could not read object listing";
                    LOGGER.error(msg, e);
                    throw new WebApplicationException(msg, e);
                } finally {
                    objectEntryIterator.close();
                }
            };

            return Response
                .ok(streamingOutput)
                .build();
        } catch (IllegalArgumentException exc) {
            LOGGER.error(exc);
            return buildErrorResponse(VitamCode.STORAGE_MISSING_HEADER);
        } catch (Exception exc) {
            LOGGER.error(exc);
            return buildErrorResponse(VitamCode.STORAGE_TECHNICAL_INTERNAL_ERROR);
        }
    }

      StorageResource(StorageConfiguration configuration);
    @VisibleForTesting  StorageResource(StorageDistribution storageDistribution, TimestampGenerator timestampGenerator);

}