test_class.file: core/src/test/java/net/adamcin/oakpal/core/UtilTest.java
test_class.identifier: UtilTest
test_case.body: @Test
      public void testMapManifestHeaderResources() throws Exception {
          final Logger logger = getLoggerFactory().getLogger(Util.class);
          final Level oldLevel = logger.getLevel();
          final File mfDir = new File("src/test/resources/utiljar");
          final File mfFile = new File(mfDir, JarFile.MANIFEST_NAME);
          try (InputStream mfStream = new FileInputStream(mfFile)) {
              Manifest manifest = new Manifest(mfStream);
  
              final File targetDir = new File("target/test-temp");
              targetDir.mkdirs();
              final File mfJar = new File(targetDir, "utiljar.jar");
              if (mfJar.exists()) {
                  mfJar.delete();
              }
  
              try (JarOutputStream mfJarOut = new JarOutputStream(new FileOutputStream(mfJar), manifest)) {
                  // nothing to add
              }
  
              // test against directory manifest only
              Map<URL, List<URL>> dirMapped = Util.mapManifestHeaderResources("Good-RelPaths",
                      Collections.singletonList(mfDir));
              assertEquals("Expect two good paths for directory manifest: " + dirMapped, 2,
                      dirMapped.values().iterator().next().size());
  
              // test against constructed jar manifest only
              Map<URL, List<URL>> mapped = Util.mapManifestHeaderResources("Good-RelPaths",
                      Collections.singletonList(mfJar));
              assertEquals("Expect two good paths for jar manifest: " + mapped, 2,
                      mapped.values().iterator().next().size());
  
              // test mapping of both manifests for two resources each
              Map<URL, List<URL>> bothMapped = Util.mapManifestHeaderResources("Good-RelPaths",
                      Arrays.asList(mfDir, mfJar));
              assertEquals("Expect two entries in both mapped: " + bothMapped, 2,
                      bothMapped.size());
              assertTrue("Expect two good paths for all entries when both mapped: " + bothMapped,
                      bothMapped.values().stream().allMatch(resources -> resources.size() == 2));
          } finally {
              logger.setLevel(oldLevel);
          }
      }
test_case.class_method_signature: UtilTest.testMapManifestHeaderResources()
test_case.full_signature: @Test public void testMapManifestHeaderResources()
test_case.identifier: testMapManifestHeaderResources
test_case.invocations: getLogger getLoggerFactory getLevel mkdirs exists delete mapManifestHeaderResources singletonList assertEquals size next iterator values mapManifestHeaderResources singletonList assertEquals size next iterator values mapManifestHeaderResources asList assertEquals size assertTrue allMatch stream values size setLevel
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMapManifestHeaderResources()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(Util.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(Util.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.file: core/src/main/java/net/adamcin/oakpal/core/Util.java
focal_class.identifier: Util
focal_class.class_method_signature: Util.Util()
focal_class.full_signature: private  Util()
focal_class.identifier: Util
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  Util()
focal_class.class_method_signature: Util.isEmpty(final String value)
focal_class.full_signature: static boolean isEmpty(final String value)
focal_class.identifier: isEmpty
focal_class.modifiers: static
focal_class.parameters: (final String value)
focal_class.return: boolean
focal_class.signature: boolean isEmpty(final String value)
focal_class.class_method_signature: Util.wrapSessionReadOnly(final Session session)
focal_class.full_signature: public static Session wrapSessionReadOnly(final Session session)
focal_class.identifier: wrapSessionReadOnly
focal_class.modifiers: public static
focal_class.parameters: (final Session session)
focal_class.return: Session
focal_class.signature: Session wrapSessionReadOnly(final Session session)
focal_class.class_method_signature: Util.getManifestHeaderValues(final Manifest manifest, final String headerName)
focal_class.full_signature: public static List<String> getManifestHeaderValues(final Manifest manifest, final String headerName)
focal_class.identifier: getManifestHeaderValues
focal_class.modifiers: public static
focal_class.parameters: (final Manifest manifest, final String headerName)
focal_class.return: List<String>
focal_class.signature: List<String> getManifestHeaderValues(final Manifest manifest, final String headerName)
focal_class.class_method_signature: Util.escapeManifestHeaderValue(final @NotNull String... values)
focal_class.full_signature: public static String escapeManifestHeaderValue(final @NotNull String... values)
focal_class.identifier: escapeManifestHeaderValue
focal_class.modifiers: public static
focal_class.parameters: (final @NotNull String... values)
focal_class.return: String
focal_class.signature: String escapeManifestHeaderValue(final @NotNull String... values)
focal_class.class_method_signature: Util.escapeManifestHeaderValues(final @NotNull List<String> values)
focal_class.full_signature: public static String escapeManifestHeaderValues(final @NotNull List<String> values)
focal_class.identifier: escapeManifestHeaderValues
focal_class.modifiers: public static
focal_class.parameters: (final @NotNull List<String> values)
focal_class.return: String
focal_class.signature: String escapeManifestHeaderValues(final @NotNull List<String> values)
focal_class.class_method_signature: Util.resolveManifestResources(final URL manifestUrl, final List<String> resources)
focal_class.full_signature: public static List<URL> resolveManifestResources(final URL manifestUrl, final List<String> resources)
focal_class.identifier: resolveManifestResources
focal_class.modifiers: public static
focal_class.parameters: (final URL manifestUrl, final List<String> resources)
focal_class.return: List<URL>
focal_class.signature: List<URL> resolveManifestResources(final URL manifestUrl, final List<String> resources)
focal_class.class_method_signature: Util.mapManifestHeaderResources(final String headerName, final ClassLoader classLoader)
focal_class.full_signature: public static Map<URL, List<URL>> mapManifestHeaderResources(final String headerName, final ClassLoader classLoader)
focal_class.identifier: mapManifestHeaderResources
focal_class.modifiers: public static
focal_class.parameters: (final String headerName, final ClassLoader classLoader)
focal_class.return: Map<URL, List<URL>>
focal_class.signature: Map<URL, List<URL>> mapManifestHeaderResources(final String headerName, final ClassLoader classLoader)
focal_class.class_method_signature: Util.mapManifestHeaderResources(final String headerName, final List<File> files)
focal_class.full_signature: public static Map<URL, List<URL>> mapManifestHeaderResources(final String headerName, final List<File> files)
focal_class.identifier: mapManifestHeaderResources
focal_class.modifiers: public static
focal_class.parameters: (final String headerName, final List<File> files)
focal_class.return: Map<URL, List<URL>>
focal_class.signature: Map<URL, List<URL>> mapManifestHeaderResources(final String headerName, final List<File> files)
focal_class.class_method_signature: Util.mapManifestHeaderResources(final String headerName, final URL manifestUrl)
focal_class.full_signature: public static Map<URL, List<URL>> mapManifestHeaderResources(final String headerName, final URL manifestUrl)
focal_class.identifier: mapManifestHeaderResources
focal_class.modifiers: public static
focal_class.parameters: (final String headerName, final URL manifestUrl)
focal_class.return: Map<URL, List<URL>>
focal_class.signature: Map<URL, List<URL>> mapManifestHeaderResources(final String headerName, final URL manifestUrl)
focal_class.class_method_signature: Util.getDefaultClassLoader()
focal_class.full_signature: static ClassLoader getDefaultClassLoader()
focal_class.identifier: getDefaultClassLoader
focal_class.modifiers: static
focal_class.parameters: ()
focal_class.return: ClassLoader
focal_class.signature: ClassLoader getDefaultClassLoader()
focal_class.class_method_signature: Util.debugFilter(final Logger logger, final String format)
focal_class.full_signature: public static Predicate<T> debugFilter(final Logger logger, final String format)
focal_class.identifier: debugFilter
focal_class.modifiers: public static
focal_class.parameters: (final Logger logger, final String format)
focal_class.return: Predicate<T>
focal_class.signature: Predicate<T> debugFilter(final Logger logger, final String format)
focal_class.class_method_signature: Util.traceFilter(final Logger logger, final String format)
focal_class.full_signature: public static Predicate<T> traceFilter(final Logger logger, final String format)
focal_class.identifier: traceFilter
focal_class.modifiers: public static
focal_class.parameters: (final Logger logger, final String format)
focal_class.return: Predicate<T>
focal_class.signature: Predicate<T> traceFilter(final Logger logger, final String format)
focal_class.class_method_signature: Util.composeTry(final Function<R, M> monadUnit,
                                                        final Supplier<M> monadZero,
                                                        final TryFunction<T, R> onElement,
                                                        final BiConsumer<T, Exception> onError)
focal_class.full_signature: @Deprecated public static Function<T, M> composeTry(final Function<R, M> monadUnit,
                                                        final Supplier<M> monadZero,
                                                        final TryFunction<T, R> onElement,
                                                        final BiConsumer<T, Exception> onError)
focal_class.identifier: composeTry
focal_class.modifiers: @Deprecated public static
focal_class.parameters: (final Function<R, M> monadUnit,
                                                        final Supplier<M> monadZero,
                                                        final TryFunction<T, R> onElement,
                                                        final BiConsumer<T, Exception> onError)
focal_class.return: Function<T, M>
focal_class.signature: Function<T, M> composeTry(final Function<R, M> monadUnit,
                                                        final Supplier<M> monadZero,
                                                        final TryFunction<T, R> onElement,
                                                        final BiConsumer<T, Exception> onError)
focal_class.class_method_signature: Util.optFunc(final Function<T, R> inputFunc)
focal_class.full_signature: @Deprecated public static Function<T, Optional<R>> optFunc(final Function<T, R> inputFunc)
focal_class.identifier: optFunc
focal_class.modifiers: @Deprecated public static
focal_class.parameters: (final Function<T, R> inputFunc)
focal_class.return: Function<T, Optional<R>>
focal_class.signature: Function<T, Optional<R>> optFunc(final Function<T, R> inputFunc)
focal_class.class_method_signature: Util.compose(final Function<T, I> before, final Function<I, R> after)
focal_class.full_signature: @Deprecated public static Function<T, R> compose(final Function<T, I> before, final Function<I, R> after)
focal_class.identifier: compose
focal_class.modifiers: @Deprecated public static
focal_class.parameters: (final Function<T, I> before, final Function<I, R> after)
focal_class.return: Function<T, R>
focal_class.signature: Function<T, R> compose(final Function<T, I> before, final Function<I, R> after)
focal_method.body: public static Map<URL, List<URL>> mapManifestHeaderResources(final String headerName, final ClassLoader classLoader) throws IOException {
          Map<URL, List<URL>> map = new LinkedHashMap<>();
          Enumeration<URL> resEnum = classLoader.getResources(JarFile.MANIFEST_NAME);
          while (resEnum.hasMoreElements()) {
              URL url = resEnum.nextElement();
              try (InputStream is = url.openStream()) {
                  Manifest manifest = new Manifest(is);
                  List<URL> headerResources = resolveManifestResources(url, getManifestHeaderValues(manifest, headerName));
                  map.put(url, headerResources);
              }
          }
  
          return map;
      }
focal_method.class_method_signature: Util.mapManifestHeaderResources(final String headerName, final ClassLoader classLoader)
focal_method.full_signature: public static Map<URL, List<URL>> mapManifestHeaderResources(final String headerName, final ClassLoader classLoader)
focal_method.identifier: mapManifestHeaderResources
focal_method.invocations: getResources hasMoreElements nextElement openStream resolveManifestResources getManifestHeaderValues put
focal_method.modifiers: public static
focal_method.parameters: (final String headerName, final ClassLoader classLoader)
focal_method.return: Map<URL, List<URL>>
focal_method.signature: Map<URL, List<URL>> mapManifestHeaderResources(final String headerName, final ClassLoader classLoader)