/******************************************************************************************************************* * * {@inheritDoc} * ******************************************************************************************************************/ @Override @Nonnull public RestResponse<CddbAlbum> findCddbAlbum (final @Nonnull Metadata metadata) throws IOException, InterruptedException { return metadata.get(CDDB).map(_f(this::findCddbAlbum)).orElse(CddbResponse.empty()); }
/******************************************************************************************************************* * * * ******************************************************************************************************************/ @AfterClass public void printStats() { log.info("STATS: {}", stats.entrySet().stream().map(Object::toString).collect(joining(", "))); unmatched.forEach(path -> log.info("STATS: unmatched with CDDB: {}", path)); stats.values().stream().flatMap(s -> s.withoutCddb.stream()).collect(toSet()) .stream().forEachOrdered(path -> log.info("STATS: without CDDB: {}", path)); modelBuilders.entrySet().forEach(_c(entry -> verifyGlobalModel(entry.getValue().toModel(), entry.getKey()))); }
.results() .stream() .forEach(_c(child -> content.addObject(child.as(DIDLAdapter).toObject()))); numberReturned = (int)content.getCount(); break;
/******************************************************************************************************************* * * ******************************************************************************************************************/ @Nonnull private Resource[] findWebResources() throws IOException { final ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); final ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(classLoader); final List<Resource> resources = Stream.of(resolver.getResources("classpath*:/webapp")) .map(_f(x -> Resource.newResource(x.getURI()))) .collect(toList()); return resources.toArray(new Resource[0]); } }
/******************************************************************************************************************* * * @param id the audio file id * @param rangeHeader the "Range" HTTP header * @return the binary contents * ******************************************************************************************************************/ @RequestMapping(value = "/audiofile/{id}/content") public ResponseEntity<ResourceRegion> getAudioFileContent ( final @PathVariable String id, final @RequestHeader(name = "Range", required = false) String rangeHeader) { log.info("getAudioFileContent({})", id); checkStatus(); return catalog.findAudioFiles().withId(new Id(id)).optionalResult() .map(_f(af -> audioFileContentResponse(af, rangeHeader))) .orElseThrow(NotFoundException::new); }
.flatMap(_f(release -> mbMetadataProvider.getResource(RELEASE, release.getId(), RELEASE_INCLUDES).get() .getMediumList().getMedium() .stream()
.map(_f(track -> handleTrack(rmd, cddb, recordIri, track))) .collect(toList()));