io.opentelemetry.contrib.staticinstrumenter.plugin.maven.JarSupport Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of static-instrumentation-maven-plugin Show documentation
Show all versions of static-instrumentation-maven-plugin Show documentation
Maven3 plugin for static instrumentation of projects code and dependencies
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.contrib.staticinstrumenter.plugin.maven;
import java.io.IOException;
import java.util.Enumeration;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
final class JarSupport {
private JarSupport() {}
@FunctionalInterface
interface ThrowingConsumer {
void accept(T t) throws E;
}
static void consumeEntries(JarFile jarFile, ThrowingConsumer consumer)
throws IOException {
Enumeration enums = jarFile.entries();
while (enums.hasMoreElements()) {
JarEntry entry = enums.nextElement();
consumer.accept(entry);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy