@Test public void accepts() { ctx.registerService(AssetRenditionsDownloadOrchestrator.class, new AssetRenditionsZipperImpl()); AssetRenditionsZipperImpl zipper = (AssetRenditionsZipperImpl) ctx.getService(AssetRenditionsDownloadOrchestrator.class); ctx.request().setQueryString(AssetRenditionsDownloadOrchestrator.REQUEST_PARAMETER_NAME + "=" + AssetRenditionsZipperImpl.NAME); assertTrue(zipper.accepts(ctx.request(), Collections.emptyList(), Collections.emptyList())); }
@Override public boolean accepts(SlingHttpServletRequest request, List<AssetModel> assets, List<String> renditionNames) { return NAME.equals(request.getRequestParameter(REQUEST_PARAMETER_NAME).getString()); }
AssetRenditionsZipperImpl implements AssetRenditionsDownloadOrchestrator { @Override public boolean accepts(SlingHttpServletRequest request, List<AssetModel> assets, List<String> renditionNames) { return NAME.equals(request.getRequestParameter(REQUEST_PARAMETER_NAME).getString()); } }
AssetRenditionsZipperImpl implements AssetRenditionsDownloadOrchestrator { @Override public boolean accepts(SlingHttpServletRequest request, List<AssetModel> assets, List<String> renditionNames) { return NAME.equals(request.getRequestParameter(REQUEST_PARAMETER_NAME).getString()); }  }
AssetRenditionsZipperImpl implements AssetRenditionsDownloadOrchestrator { @Override public boolean accepts(SlingHttpServletRequest request, List<AssetModel> assets, List<String> renditionNames) { return NAME.equals(request.getRequestParameter(REQUEST_PARAMETER_NAME).getString()); }  @Override void execute(final SlingHttpServletRequest request,
                        final SlingHttpServletResponse response,
                        final List<AssetModel> assets,
                        final List<String> renditionNames); @Override boolean accepts(SlingHttpServletRequest request, List<AssetModel> assets, List<String> renditionNames); }
AssetRenditionsZipperImpl implements AssetRenditionsDownloadOrchestrator { @Override public boolean accepts(SlingHttpServletRequest request, List<AssetModel> assets, List<String> renditionNames) { return NAME.equals(request.getRequestParameter(REQUEST_PARAMETER_NAME).getString()); }  @Override void execute(final SlingHttpServletRequest request,
                        final SlingHttpServletResponse response,
                        final List<AssetModel> assets,
                        final List<String> renditionNames); @Override boolean accepts(SlingHttpServletRequest request, List<AssetModel> assets, List<String> renditionNames); static final String NAME; static final String VAR_ASSET_NAME; static final String VAR_ASSET_EXTENSION; static final String VAR_RENDITION_NAME; static final String VAR_RENDITION_EXTENSION; static final String VAR_ASSET_FILE_NAME; static final String VAR_ASSET_TITLE; static final String ZIP_EXTENSION; static final String DEFAULT_NO_CONTENT_FILE_NAME; static final String DEFAULT_NO_CONTENT_MESSAGE; }