ManifestRest extends BaseRest { @Path("/{spaceId}") @GET public Response getManifest(@PathParam("spaceId") String spaceId, @QueryParam("format") String format, @QueryParam("storeID") String storeId) { if (!enabled) { return Response.status(501) .entity("This endpoint is currently disabled.") .build(); } if (format == null) { format = DEFAULT_FORMAT; } String account = getSubdomain(); log.info("getting manifest, {}:{}:{} [{}]", account, storeId, spaceId, format); try { InputStream manifest = manifestResource.getManifest(account, storeId, spaceId, format); return Response.ok(manifest) .type(ManifestFormat.valueOf(format) .getMimeType()).build(); } catch (ManifestArgumentException e) { log.error("Error for, {}:{} [{}]", new Object[] {storeId, spaceId, format, e}); return responseBadRequest(e); } catch (ManifestNotFoundException e) { log.error("Error for, {}:{} [{}]", new Object[] {storeId, spaceId, format, e}); return responseNotFound(e.getMessage()); } catch (Exception e) { log.error("Error for, {}:{} [{}]", new Object[] {storeId, spaceId, format, e}); return responseBad(e); } } @Autowired  ManifestRest(ManifestResource manifestResource,
                        StorageProviderFactory storageProviderFactory); @Path("/{spaceId}") @GET Response getManifest(@PathParam("spaceId") String spaceId,
                                @QueryParam("format") String format,
                                @QueryParam("storeID") String storeId); @Path("/{spaceId}") @POST Response generateManifest(@PathParam("spaceId") String spaceId,
                                     @QueryParam("format") String format,
                                     @QueryParam("storeID") String storeId); void setEnabled(boolean enabled);  }
@Test public void getManifestSync() throws Exception { String format = ManifestFormat.TSV.name(); expectGetManifest(format); setupAccountId(); replayAll(); Response response = rest.getManifest(spaceId, format, storeId); InputStream is = (InputStream) response.getEntity(); assertEquals(testContent, IOUtil.readStringFromStream(is)); }