Package com.artipie.conan.http
Class ConansEntityV2.PkgBinFile
java.lang.Object
com.artipie.conan.http.ConansEntityV2.PkgBinFile
- All Implemented Interfaces:
com.artipie.http.Slice
- Enclosing class:
ConansEntityV2
Provides requested file for package binary.
- Since:
- 0.1
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.artipie.http.Slice
com.artipie.http.Slice.Wrap
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected static <T> CompletableFuture
<com.artipie.conan.http.BaseConanSlice.RequestResult> generateJson
(String[] keys, Function<String, io.vavr.Tuple2<Key, CompletableFuture<T>>> mapper, Function<io.vavr.Tuple2<String, T>, Optional<String>> generator, Function<javax.json.JsonObjectBuilder, String> ctor) Generate RequestResult based on array of keys (files) and several handlers.protected CompletableFuture
<String> generateMDhash
(Key key) Generates An md5 hash for package file.CompletableFuture
<com.artipie.conan.http.BaseConanSlice.RequestResult> Processess the request and returns result data for this request.protected Storage
Returns current Artipie storage instance.com.artipie.http.Response
response
(String line, Iterable<Map.Entry<String, String>> headers, org.reactivestreams.Publisher<ByteBuffer> body)
-
Constructor Details
-
PkgBinFile
Ctor.- Parameters:
storage
- Current Artipie storage instance.
-
-
Method Details
-
getResult
public CompletableFuture<com.artipie.conan.http.BaseConanSlice.RequestResult> getResult(com.artipie.http.rq.RequestLineFrom request, String hostname, Matcher matcher) Processess the request and returns result data for this request.- Parameters:
request
- Artipie request line helper object instance.hostname
- Current server host name string to construct and process URLs.matcher
- Matched pattern matcher object for the current path wrapper.- Returns:
- Future object, providing request result data.
-
response
public com.artipie.http.Response response(String line, Iterable<Map.Entry<String, String>> headers, org.reactivestreams.Publisher<ByteBuffer> body) - Specified by:
response
in interfacecom.artipie.http.Slice
-
getStorage
Returns current Artipie storage instance.- Returns:
- Storage object instance.
-
generateMDhash
Generates An md5 hash for package file.- Parameters:
key
- Storage key for package file.- Returns:
- An md5 hash string for file content.
-
generateJson
protected static <T> CompletableFuture<com.artipie.conan.http.BaseConanSlice.RequestResult> generateJson(String[] keys, Function<String, io.vavr.Tuple2<Key, CompletableFuture<T>>> mapper, Function<io.vavr.Tuple2<String, T>, Optional<String>> generator, Function<javax.json.JsonObjectBuilder, String> ctor) Generate RequestResult based on array of keys (files) and several handlers.- Type Parameters:
T
- Generators result type.- Parameters:
keys
- Array of keys to process.mapper
- Mapper of key to the tuple with key invalid input: '&' completable future.generator
- Filters and generates value for json.ctor
- Constructs resulting json string.- Returns:
- Json RequestResult in CompletableFuture.
-