Search in sources :

Example 1 with Stream

use of oap.util.Stream in project oap by oaplatform.

the class Client method uploadFile.

@SneakyThrows
public Response uploadFile(String uri, String prefix, Path path) {
    final ContentType contentType = ContentType.create(java.nio.file.Files.probeContentType(path));
    OkHttpClient client = new OkHttpClient();
    final MultipartBody body = new MultipartBody.Builder().setType(MultipartBody.FORM).addFormDataPart("upfile", path.toFile().getName(), RequestBody.create(MediaType.parse(contentType.toString()), path.toFile())).addFormDataPart("prefix", prefix).build();
    okhttp3.Request request = new okhttp3.Request.Builder().url(uri).post(body).build();
    final okhttp3.Response response = client.newCall(request).execute();
    final Headers headers = response.headers();
    final java.util.stream.Stream<String> stream = headers.names().stream();
    final Map<String, String> h = stream.collect(Collectors.toMap(n -> n, headers::get));
    return new Response(response.code(), response.message(), h, Optional.ofNullable(response.body().contentType()).map(mt -> ContentType.create(mt.type() + "/" + mt.subtype(), mt.charset())), response.body().bytes());
}
Also used : Binder(oap.json.Binder) HttpPost(org.apache.http.client.methods.HttpPost) SSLContext(javax.net.ssl.SSLContext) Arrays(java.util.Arrays) BufferedInputStream(java.io.BufferedInputStream) IOReactorConfig(org.apache.http.impl.nio.reactor.IOReactorConfig) SneakyThrows(lombok.SneakyThrows) UrlEncodedFormEntity(org.apache.http.client.entity.UrlEncodedFormEntity) Maps(oap.util.Maps) Date(java.util.Date) TimeoutException(java.util.concurrent.TimeoutException) RequestConfig(org.apache.http.client.config.RequestConfig) HttpAsyncClients(org.apache.http.impl.nio.client.HttpAsyncClients) Header(org.apache.http.Header) HTTP_NOT_MODIFIED(java.net.HttpURLConnection.HTTP_NOT_MODIFIED) SSLIOSessionStrategy(org.apache.http.nio.conn.ssl.SSLIOSessionStrategy) Future(java.util.concurrent.Future) SSLContexts(org.apache.http.ssl.SSLContexts) Map(java.util.Map) ToString(lombok.ToString) TypeRef(oap.reflect.TypeRef) NoopIOSessionStrategy(org.apache.http.nio.conn.NoopIOSessionStrategy) URI(java.net.URI) Stream(oap.util.Stream) Path(java.nio.file.Path) MediaType(okhttp3.MediaType) Closeables(oap.io.Closeables) PoolingNHttpClientConnectionManager(org.apache.http.impl.nio.conn.PoolingNHttpClientConnectionManager) TrustManagerFactory(javax.net.ssl.TrustManagerFactory) ProgressInputStream.progress(oap.io.ProgressInputStream.progress) HttpEntity(org.apache.http.HttpEntity) ContentType(org.apache.http.entity.ContentType) DefaultConnectionKeepAliveStrategy(org.apache.http.impl.client.DefaultConnectionKeepAliveStrategy) StringEntity(org.apache.http.entity.StringEntity) CloseableHttpAsyncClient(org.apache.http.impl.nio.client.CloseableHttpAsyncClient) KeyStore(java.security.KeyStore) PublicSuffixMatcherLoader(org.apache.http.conn.util.PublicSuffixMatcherLoader) MILLISECONDS(java.util.concurrent.TimeUnit.MILLISECONDS) Collectors(java.util.stream.Collectors) StandardCharsets(java.nio.charset.StandardCharsets) UncheckedIOException(java.io.UncheckedIOException) Slf4j(lombok.extern.slf4j.Slf4j) Try(oap.util.Try) List(java.util.List) HttpAsyncClientBuilder(org.apache.http.impl.nio.client.HttpAsyncClientBuilder) MultipartBody(okhttp3.MultipartBody) HttpGet(org.apache.http.client.methods.HttpGet) ByteStreams(com.google.common.io.ByteStreams) DefaultHostnameVerifier(org.apache.http.conn.ssl.DefaultHostnameVerifier) Optional(java.util.Optional) NameValuePair(org.apache.http.NameValuePair) UnsupportedEncodingException(java.io.UnsupportedEncodingException) Pair(oap.util.Pair) BasicNameValuePair(org.apache.http.message.BasicNameValuePair) DateUtils(org.apache.http.client.utils.DateUtils) RegistryBuilder(org.apache.http.config.RegistryBuilder) Pair.__(oap.util.Pair.__) Files(oap.io.Files) CookieSpecs(org.apache.http.client.config.CookieSpecs) HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) ByteArrayEntity(org.apache.http.entity.ByteArrayEntity) Headers(okhttp3.Headers) RequestBody(okhttp3.RequestBody) HTTP_OK(java.net.HttpURLConnection.HTTP_OK) HttpDelete(org.apache.http.client.methods.HttpDelete) Collectors.toMap(oap.util.Maps.Collectors.toMap) Cookie(org.apache.http.cookie.Cookie) StringUtils.split(org.apache.commons.lang3.StringUtils.split) SchemeIOSessionStrategy(org.apache.http.nio.conn.SchemeIOSessionStrategy) lombok.val(lombok.val) AsyncCallbacks(oap.concurrent.AsyncCallbacks) FutureCallback(org.apache.http.concurrent.FutureCallback) IOException(java.io.IOException) File(java.io.File) ExecutionException(java.util.concurrent.ExecutionException) Consumer(java.util.function.Consumer) IOReactorException(org.apache.http.nio.reactor.IOReactorException) DefaultConnectingIOReactor(org.apache.http.impl.nio.reactor.DefaultConnectingIOReactor) HTTP_MOVED_TEMP(java.net.HttpURLConnection.HTTP_MOVED_TEMP) OkHttpClient(okhttp3.OkHttpClient) HttpPut(org.apache.http.client.methods.HttpPut) BasicCookieStore(org.apache.http.impl.client.BasicCookieStore) IoStreams(oap.io.IoStreams) PLAIN(oap.io.IoStreams.Encoding.PLAIN) Closeable(java.io.Closeable) HttpResponse(org.apache.http.HttpResponse) InputStreamEntity(org.apache.http.entity.InputStreamEntity) InputStream(java.io.InputStream) APPLICATION_OCTET_STREAM(org.apache.http.entity.ContentType.APPLICATION_OCTET_STREAM) OkHttpClient(okhttp3.OkHttpClient) ContentType(org.apache.http.entity.ContentType) Headers(okhttp3.Headers) HttpAsyncClientBuilder(org.apache.http.impl.nio.client.HttpAsyncClientBuilder) RegistryBuilder(org.apache.http.config.RegistryBuilder) HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) ToString(lombok.ToString) HttpResponse(org.apache.http.HttpResponse) MultipartBody(okhttp3.MultipartBody) SneakyThrows(lombok.SneakyThrows)

Example 2 with Stream

use of oap.util.Stream in project oap by oaplatform.

the class WsService method handleInternal.

private void handleInternal(Request request, Response response, Reflection.Method method, Name name, Pair<String, Session> session) {
    log.trace("{}: Internal session status: [{}]", service(), session);
    Optional<WsMethod> wsMethod = method.findAnnotation(WsMethod.class);
    Function<Reflection.Parameter, Object> func = (p) -> {
        val ret = getValue(session, request, wsMethod, p).orElse(Optional.empty());
        if (ret instanceof Optional)
            return ((Optional<?>) ret).orElse(null);
        return ret;
    };
    HttpResponse interceptorResponse = session != null ? runInterceptors(request, session._2, method, func) : null;
    if (interceptorResponse != null) {
        response.respond(interceptorResponse);
    } else {
        Metrics.measureTimer(name, () -> {
            List<Reflection.Parameter> parameters = method.parameters;
            LinkedHashMap<Reflection.Parameter, Object> originalValues = getOriginalValues(session, parameters, request, wsMethod);
            ValidationErrors paramValidation = ValidationErrors.empty();
            originalValues.forEach((parameter, value) -> paramValidation.merge(Validators.forParameter(method, parameter, impl, true).validate(value, originalValues)));
            paramValidation.throwIfInvalid();
            Validators.forMethod(method, impl, true).validate(originalValues.values().toArray(new Object[originalValues.size()]), originalValues).throwIfInvalid();
            LinkedHashMap<Reflection.Parameter, Object> values = getValues(originalValues);
            Object[] paramValues = values.values().toArray(new Object[values.size()]);
            values.forEach((parameter, value) -> paramValidation.merge(Validators.forParameter(method, parameter, impl, false).validate(value, values)));
            paramValidation.throwIfInvalid();
            Validators.forMethod(method, impl, false).validate(paramValues, values).throwIfInvalid();
            Object result = method.invoke(impl, paramValues);
            Boolean isRaw = wsMethod.map(WsMethod::raw).orElse(false);
            ContentType produces = wsMethod.map(wsm -> ContentType.create(wsm.produces()).withCharset(UTF_8)).orElse(APPLICATION_JSON);
            String cookie = session != null ? new HttpResponse.CookieBuilder().withSID(session._1).withPath(sessionManager.cookiePath).withExpires(DateTime.now().plusMinutes(sessionManager.cookieExpiration)).withDomain(sessionManager.cookieDomain).withDomain(sessionManager.cookieDomain).build() : null;
            if (method.isVoid())
                response.respond(NO_CONTENT);
            else if (result instanceof HttpResponse)
                response.respond(((HttpResponse) result).withCookie(cookie));
            else if (result instanceof Optional<?>) {
                response.respond(((Optional<?>) result).map(r -> HttpResponse.ok(runPostInterceptors(r, session, method), isRaw, produces).withCookie(cookie)).orElse(NOT_FOUND));
            } else if (result instanceof Result<?, ?>) {
                Result<HttpResponse, HttpResponse> resp = ((Result<?, ?>) result).mapSuccess(r -> HttpResponse.ok(r, isRaw, produces).withCookie(cookie)).mapFailure(r -> HttpResponse.status(HTTP_INTERNAL_ERROR, "", r).withCookie(cookie));
                response.respond(resp.isSuccess() ? ((Result<?, ?>) result).mapSuccess(r -> HttpResponse.ok(runPostInterceptors(r, session, method), isRaw, produces).withCookie(cookie)).successValue : ((Result<?, ?>) result).mapFailure(r -> HttpResponse.status(HTTP_INTERNAL_ERROR, "", r).withCookie(cookie)).failureValue);
            } else if (result instanceof Stream<?>) {
                response.respond(HttpResponse.stream(((Stream<?>) result).map(v -> runPostInterceptors(v, session, method)), isRaw, produces).withCookie(cookie));
            } else
                response.respond(HttpResponse.ok(runPostInterceptors(result, session, method), isRaw, produces).withCookie(cookie));
        });
    }
}
Also used : Pair(oap.util.Pair) Result(oap.util.Result) Binder(oap.json.Binder) Metrics(oap.metrics.Metrics) NOT_FOUND(oap.http.HttpResponse.NOT_FOUND) Reflection(oap.reflect.Reflection) Pair.__(oap.util.Pair.__) HashMap(java.util.HashMap) Strings(oap.util.Strings) Function(java.util.function.Function) NO_CONTENT(oap.http.HttpResponse.NO_CONTENT) Reflect(oap.reflect.Reflect) LinkedHashMap(java.util.LinkedHashMap) HTTP_INTERNAL_ERROR(java.net.HttpURLConnection.HTTP_INTERNAL_ERROR) Map(java.util.Map) Session(oap.http.Session) TEXT_PLAIN(oap.http.ContentTypes.TEXT_PLAIN) Stream(oap.util.Stream) ReflectException(oap.reflect.ReflectException) APPLICATION_JSON(org.apache.http.entity.ContentType.APPLICATION_JSON) Name(oap.metrics.Name) Collectors.toLinkedHashMap(oap.util.Collectors.toLinkedHashMap) UTF_8(java.nio.charset.StandardCharsets.UTF_8) Handler(oap.http.Handler) Collection(java.util.Collection) lombok.val(lombok.val) ContentType(org.apache.http.entity.ContentType) DateTime(org.joda.time.DateTime) Response(oap.http.Response) JsonException(oap.json.JsonException) UUID(java.util.UUID) Request(oap.http.Request) TEXT(oap.ws.WsResponse.TEXT) Serializable(java.io.Serializable) InvocationTargetException(java.lang.reflect.InvocationTargetException) Validators(oap.ws.validate.Validators) Objects(java.util.Objects) Slf4j(lombok.extern.slf4j.Slf4j) List(java.util.List) WrappingRuntimeException(oap.util.WrappingRuntimeException) Optional(java.util.Optional) Pattern(java.util.regex.Pattern) Throwables(oap.util.Throwables) HttpResponse(oap.http.HttpResponse) ValidationErrors(oap.ws.validate.ValidationErrors) lombok.val(lombok.val) Optional(java.util.Optional) ContentType(org.apache.http.entity.ContentType) ValidationErrors(oap.ws.validate.ValidationErrors) HttpResponse(oap.http.HttpResponse) Result(oap.util.Result) Stream(oap.util.Stream)

Example 3 with Stream

use of oap.util.Stream in project oap by oaplatform.

the class Tree method trace.

public String trace(List<?> query, Predicate<T> filter) {
    final HashMap<T, HashMap<Integer, TraceOperationTypeValues>> result = new HashMap<>();
    final long[][] longQuery = convertQueryToLong(query);
    trace(root, longQuery, result, new TraceBuffer(), true);
    final String queryStr = "query = " + Stream.of(query).zipWithIndex().map(p -> dimensions.get(p._2).name + ":" + printValue(p._1)).collect(joining(",", "[", "]")) + "\n";
    final String out = result.entrySet().stream().filter(e -> filter.test(e.getKey())).map(e -> e.getKey().toString() + ": \n" + e.getValue().entrySet().stream().map(dv -> {
        final Dimension dimension = dimensions.get(dv.getKey());
        return "    " + dimension.name + "/" + dv.getKey() + ": " + dv.getValue().toString(dimension) + " " + queryToString(query, dv.getKey());
    }).collect(joining("\n"))).collect(joining("\n"));
    return queryStr + (out.length() > 0 ? "Expecting:\n" + out : "ALL OK");
}
Also used : Pair(oap.util.Pair) IntStream(java.util.stream.IntStream) Arrays(java.util.Arrays) MemoryMeter(oap.util.MemoryMeter) Pair.__(oap.util.Pair.__) ArrayUtils(org.apache.commons.lang3.ArrayUtils) HashMap(java.util.HashMap) Strings(oap.util.Strings) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Collectors.toMap(java.util.stream.Collectors.toMap) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) Lists(oap.util.Lists) Arrays.asList(java.util.Arrays.asList) Map(java.util.Map) ToString(lombok.ToString) Stream(oap.util.Stream) CONTAINS(oap.tree.Dimension.OperationType.CONTAINS) LongStream(java.util.stream.LongStream) Predicate(java.util.function.Predicate) Collections.emptyList(java.util.Collections.emptyList) Collection(java.util.Collection) lombok.val(lombok.val) OperationType(oap.tree.Dimension.OperationType) Set(java.util.Set) EqualsAndHashCode(lombok.EqualsAndHashCode) NOT_CONTAINS(oap.tree.Dimension.OperationType.NOT_CONTAINS) Collectors.joining(java.util.stream.Collectors.joining) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) Direction(oap.tree.Dimension.Direction) ANY_AS_ARRAY(oap.tree.Consts.ANY_AS_ARRAY) Optional(java.util.Optional) BitSet(java.util.BitSet) Comparator(java.util.Comparator) Collections(java.util.Collections) HashMap(java.util.HashMap) ToString(lombok.ToString)

Example 4 with Stream

use of oap.util.Stream in project oap by oaplatform.

the class MongoStorage method fsync.

@Override
public void fsync() {
    super.fsync();
    val count = new MutableInt();
    Stream.of(data.values().stream().filter(m -> m.modified >= lastFsync)).grouped(bulkSize).forEach(list -> {
        count.add(list.size());
        final List<? extends WriteModel<Metadata<T>>> bulk = Lists.map(list, metadata -> {
            val id = getIdentifier().get(metadata.object);
            return new ReplaceOneModel<>(eq("_id", new ObjectId(id)), metadata, UPDATE_OPTIONS_UPSERT);
        });
        collection.bulkWrite(bulk);
    });
    log.info("[{}] fsync total: {}, modified: {}", collection.getNamespace(), size(), count.intValue());
    lastFsync = System.currentTimeMillis();
}
Also used : lombok.val(lombok.val) ReplaceOneModel(com.mongodb.client.model.ReplaceOneModel) MutableInt(org.apache.commons.lang3.mutable.MutableInt) MongoCollection(com.mongodb.client.MongoCollection) DateTimeUtils(org.joda.time.DateTimeUtils) lombok.val(lombok.val) CodecRegistries(org.bson.codecs.configuration.CodecRegistries) WriteModel(com.mongodb.client.model.WriteModel) CodecRegistry(org.bson.codecs.configuration.CodecRegistry) Consumer(java.util.function.Consumer) Slf4j(lombok.extern.slf4j.Slf4j) MemoryStorage(oap.storage.MemoryStorage) List(java.util.List) Lists(oap.util.Lists) IdentifierBuilder(oap.storage.IdentifierBuilder) Metadata(oap.storage.Metadata) ObjectId(org.bson.types.ObjectId) Optional(java.util.Optional) Filters.eq(com.mongodb.client.model.Filters.eq) TypeReference(com.fasterxml.jackson.core.type.TypeReference) Stream(oap.util.Stream) UpdateOptions(com.mongodb.client.model.UpdateOptions) ObjectId(org.bson.types.ObjectId) MutableInt(org.apache.commons.lang3.mutable.MutableInt) ReplaceOneModel(com.mongodb.client.model.ReplaceOneModel) Metadata(oap.storage.Metadata)

Example 5 with Stream

use of oap.util.Stream in project oap by oaplatform.

the class DictionaryMojo method execute.

@Override
public void execute() throws MojoExecutionException, MojoFailureException {
    final List<Path> paths = Files.fastWildcard(Paths.get(sourceDirectory), "*.json").stream().filter(p -> {
        final boolean b = !Arrays.stream(exclude).filter(e -> FilenameUtils.wildcardMatchOnSystem(separatorsToUnix(p.toString()), e)).findAny().isPresent();
        if (!b)
            getLog().debug("exclude " + p);
        return b;
    }).collect(toList());
    getLog().debug("found " + paths);
    paths.forEach(path -> {
        getLog().info("dictionary " + path + "...");
        final DictionaryRoot dictionary = DictionaryParser.parse(path);
        final StringBuilder out = new StringBuilder();
        final String enumClass = toEnumName(dictionary.name);
        out.append("package " + dictionaryPackage + ";\n\n").append("import oap.dictionary.Dictionary;\n\n").append("import java.util.Map;\n").append("import java.util.Optional;\n").append("import java.util.List;\n\n").append("import static java.util.Collections.emptyList;\n").append("import static java.util.Collections.emptyMap;\n").append("import static java.util.Arrays.asList;\n\n").append("public enum " + enumClass + " implements Dictionary {\n");
        final Set<String> properties = dictionary.getValues().stream().flatMap(v -> v.getProperties().keySet().stream()).collect(toSet());
        final Map<String, Boolean> optional = properties.stream().collect(toMap(k -> k, k -> dictionary.getValues().stream().anyMatch(v -> !v.containsProperty(k))));
        final Map<String, Class<?>> types = properties.stream().collect(toMap(k -> k, k -> dictionary.getValues().stream().filter(v -> v.containsProperty(k)).findAny().get().getProperty(k).get().getClass()));
        out.append(dictionary.getValues().stream().map(d -> "  " + d.getId() + "(" + convert(d.getExternalId(), dictionary.externalIdAs) + ", " + d.isEnabled() + properties(d.getProperties(), properties, optional, types) + ")").collect(joining(",\n")));
        final String externalIdType = dictionary.externalIdAs.javaType.getSimpleName();
        out.append(";\n\n").append("  private final " + externalIdType + " externalId;\n").append("  private final boolean enabled;\n\n");
        for (String property : properties) {
            out.append("  private final " + propertyType(property, optional, types) + " " + property + ";\n");
        }
        out.append("\n");
        for (String property : properties) {
            out.append("  public final " + propertyType(property, optional, types) + " " + property + "(){return " + property + ";}\n");
        }
        out.append("\n  " + enumClass + "( " + externalIdType + " externalId, boolean enabled");
        final String cParameters = properties.stream().map(p -> propertyType(p, optional, types) + " " + p).collect(joining(", "));
        out.append(cParameters.length() > 0 ? ", " : "").append(cParameters + " ) {\n").append("    this.externalId = externalId;\n").append("    this.enabled = enabled;\n");
        for (String property : properties) {
            out.append("    this." + property + " = " + property + ";\n");
        }
        out.append("  }\n" + "\n" + "  public static " + enumClass + " valueOf( int externalId ) {\n" + "    switch( externalId ) {\n");
        dictionary.getValues().forEach(d -> {
            out.append("      case ").append(d.getExternalId()).append(": return ").append(d.getId()).append(";\n");
        });
        out.append("      default: ");
        if (dictionary.containsValueWithId("UNKNOWN")) {
            out.append("return UNKNOWN");
        } else {
            out.append("throw new java.lang.IllegalArgumentException( \"Unknown id \" + externalId )");
        }
        out.append(";\n" + "    }\n" + "  }\n" + "\n" + "  @Override\n" + "  public int getOrDefault( String id, int defaultValue ) {\n" + "    return defaultValue;\n" + "  }\n" + "\n" + "  @Override\n" + "  public Integer get( String id ) {\n" + "    return null;\n" + "  }\n" + "\n" + "  @Override\n" + "  public String getOrDefault( int externlId, String defaultValue ) {\n" + "    return defaultValue;\n" + "  }\n" + "\n" + "  @Override\n" + "  public boolean containsValueWithId( String id ) {\n" + "    return false;\n" + "  }\n" + "\n" + "  @Override\n" + "  public List<String> ids() {\n" + "    return emptyList();\n" + "  }\n" + "\n" + "  @Override\n" + "  public int[] externalIds() {\n" + "    return new int[0];\n" + "  }\n" + "\n" + "  @Override\n" + "  public Map<String, Object> getProperties() {\n" + "    return emptyMap();\n" + "  }\n" + "\n" + "  @Override\n" + "  public Optional<? extends Dictionary> getValueOpt( String name ) {\n" + "    return Optional.empty();\n" + "  }\n" + "\n" + "  @Override\n" + "  public Dictionary getValue( String name ) {\n" + "    return null;\n" + "  }\n" + "\n" + "  @Override\n" + "  public Dictionary getValue( int externalId ) {\n" + "    return null;\n" + "  }\n" + "\n" + "  @Override\n" + "  public List<? extends Dictionary> getValues() {\n" + "    return emptyList();\n" + "  }\n" + "\n" + "  @Override\n" + "  public String getId() {\n" + "    return name();\n" + "  }\n" + "\n" + "  @Override\n" + "  public Optional<Object> getProperty( String name ) {\n" + "    return Optional.empty();\n" + "  }\n" + "\n" + "  @Override\n" + "  public boolean isEnabled() {\n" + "    return enabled;\n" + "  }\n" + "\n" + "  @Override\n" + "  public int getExternalId() {\n" + "    return externalId;\n" + "  }\n" + "  public " + externalIdType + " externalId() {\n" + "    return externalId;\n" + "  }\n" + "\n" + "  @Override\n" + "  public boolean containsProperty( String name ) {\n" + "    return false;\n" + "  }\n").append("}\n");
        final Path outPath = Paths.get(outputDirectory, dictionaryPackage.replace(".", "/"), enumClass + ".java");
        if (!java.nio.file.Files.exists(outPath) || !Files.readString(outPath).equals(out.toString())) {
            Files.writeString(outPath, IoStreams.Encoding.PLAIN, out.toString());
        } else {
            getLog().debug(outPath + " is not modified.");
        }
    });
}
Also used : Path(java.nio.file.Path) Arrays(java.util.Arrays) Files(oap.io.Files) ExternalIdType(oap.dictionary.ExternalIdType) Parameter(org.apache.maven.plugins.annotations.Parameter) StringUtils(org.apache.commons.lang3.StringUtils) ArrayList(java.util.ArrayList) ClassUtils(org.apache.commons.lang3.ClassUtils) Mojo(org.apache.maven.plugins.annotations.Mojo) Collectors.toMap(java.util.stream.Collectors.toMap) Map(java.util.Map) LifecyclePhase(org.apache.maven.plugins.annotations.LifecyclePhase) Stream(oap.util.Stream) Path(java.nio.file.Path) StringUtils.split(org.apache.commons.lang3.StringUtils.split) Collectors.toSet(java.util.stream.Collectors.toSet) DictionaryParser(oap.dictionary.DictionaryParser) Set(java.util.Set) DictionaryRoot(oap.dictionary.DictionaryRoot) MojoExecutionException(org.apache.maven.plugin.MojoExecutionException) Collectors.joining(java.util.stream.Collectors.joining) MojoFailureException(org.apache.maven.plugin.MojoFailureException) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) IoStreams(oap.io.IoStreams) Paths(java.nio.file.Paths) FilenameUtils.separatorsToUnix(org.apache.commons.io.FilenameUtils.separatorsToUnix) FilenameUtils(org.apache.commons.io.FilenameUtils) AbstractMojo(org.apache.maven.plugin.AbstractMojo) DictionaryRoot(oap.dictionary.DictionaryRoot)

Aggregations

List (java.util.List)5 Stream (oap.util.Stream)5 Map (java.util.Map)4 Optional (java.util.Optional)4 lombok.val (lombok.val)4 Arrays (java.util.Arrays)3 Slf4j (lombok.extern.slf4j.Slf4j)3 Path (java.nio.file.Path)2 ArrayList (java.util.ArrayList)2 Collection (java.util.Collection)2 HashMap (java.util.HashMap)2 Set (java.util.Set)2 Collectors.joining (java.util.stream.Collectors.joining)2 Collectors.toList (java.util.stream.Collectors.toList)2 Collectors.toMap (java.util.stream.Collectors.toMap)2 Binder (oap.json.Binder)2 Lists (oap.util.Lists)2 Pair (oap.util.Pair)2 Pair.__ (oap.util.Pair.__)2 ContentType (org.apache.http.entity.ContentType)2