All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.opentelemetry.contrib.staticinstrumenter.plugin.maven.JarSupport Maven / Gradle / Ivy

There is a newer version: 1.26.0-alpha
Show newest version
/*
 * 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