@Test void testGetFileContentError() { final BinaryService service = new FileBinaryService(); final IRI fileIRI = rdf.createIRI("file: final CompletableFuture<InputStream> future = service.get(fileIRI).thenApply(Binary::getContent) .toCompletableFuture(); assertThrows(CompletionException.class, () -> future.join(), "Fetching from invalid file should have thrown an exception!"); }
@Override public CompletionStage<Binary> get(final IRI identifier) { return supplyAsync(() -> new FileBinary(getFileFromIdentifier(identifier))); }
FileBinaryService implements BinaryService { @Override public CompletionStage<Binary> get(final IRI identifier) { return supplyAsync(() -> new FileBinary(getFileFromIdentifier(identifier))); } }
FileBinaryService implements BinaryService { @Override public CompletionStage<Binary> get(final IRI identifier) { return supplyAsync(() -> new FileBinary(getFileFromIdentifier(identifier))); } FileBinaryService(); @Inject  FileBinaryService(final IdentifierService idService);  FileBinaryService(final IdentifierService idService, final String basePath,
            final int hierarchy, final int length); private  FileBinaryService(final IdentifierService idService, final Config config); }
FileBinaryService implements BinaryService { @Override public CompletionStage<Binary> get(final IRI identifier) { return supplyAsync(() -> new FileBinary(getFileFromIdentifier(identifier))); } FileBinaryService(); @Inject  FileBinaryService(final IdentifierService idService);  FileBinaryService(final IdentifierService idService, final String basePath,
            final int hierarchy, final int length); private  FileBinaryService(final IdentifierService idService, final Config config); @Override CompletionStage<Binary> get(final IRI identifier); @Override CompletionStage<Void> purgeContent(final IRI identifier); @Override CompletionStage<Void> setContent(final BinaryMetadata metadata, final InputStream stream); @Override String generateIdentifier(final IRI identifier); }
FileBinaryService implements BinaryService { @Override public CompletionStage<Binary> get(final IRI identifier) { return supplyAsync(() -> new FileBinary(getFileFromIdentifier(identifier))); } FileBinaryService(); @Inject  FileBinaryService(final IdentifierService idService);  FileBinaryService(final IdentifierService idService, final String basePath,
            final int hierarchy, final int length); private  FileBinaryService(final IdentifierService idService, final Config config); @Override CompletionStage<Binary> get(final IRI identifier); @Override CompletionStage<Void> purgeContent(final IRI identifier); @Override CompletionStage<Void> setContent(final BinaryMetadata metadata, final InputStream stream); @Override String generateIdentifier(final IRI identifier); static final String CONFIG_FILE_BINARY_PATH; static final String CONFIG_FILE_BINARY_HIERARCHY; static final String CONFIG_FILE_BINARY_LENGTH; }