test_class.declarator: LOGGER = LoggerFactory.getLogger(OpearFileTest.class)
test_class.modifier: private static final
test_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(OpearFileTest.class);
test_class.type: Logger
test_class.var_name: LOGGER
test_class.declarator: baseDir = new File("src/test/resources/OpearFileTest")
test_class.modifier: final
test_class.original_string: final File baseDir = new File("src/test/resources/OpearFileTest");
test_class.type: File
test_class.var_name: baseDir
test_class.declarator: testTarget = new File("target/test-output/OpearFileTest")
test_class.modifier: final
test_class.original_string: final File testTarget = new File("target/test-output/OpearFileTest");
test_class.type: File
test_class.var_name: testTarget
test_class.declarator: deepTestSrc = new File(baseDir, "deep_test_src")
test_class.modifier: final
test_class.original_string: final File deepTestSrc = new File(baseDir, "deep_test_src");
test_class.type: File
test_class.var_name: deepTestSrc
test_class.declarator: deepTestTarget = new File(testTarget, "deep_test.jar")
test_class.modifier: final
test_class.original_string: final File deepTestTarget = new File(testTarget, "deep_test.jar");
test_class.type: File
test_class.var_name: deepTestTarget
test_class.declarator: embedModuleSrc = new File(baseDir, "embedded_module_src")
test_class.modifier: final
test_class.original_string: final File embedModuleSrc = new File(baseDir, "embedded_module_src");
test_class.type: File
test_class.var_name: embedModuleSrc
test_class.declarator: embedModuleTarget = new File(testTarget, "embedded_module.jar")
test_class.modifier: final
test_class.original_string: final File embedModuleTarget = new File(testTarget, "embedded_module.jar");
test_class.type: File
test_class.var_name: embedModuleTarget
test_class.file: core/src/test/java/net/adamcin/oakpal/core/opear/OpearFileTest.java
test_class.identifier: OpearFileTest
test_case.body: @Test
      public void testGetPlanClassLoader_empty() throws Exception {
          final File cacheDir = new File("target/test-output/OpearFileTest/testGetPlanClassLoader_empty/cache");
          if (cacheDir.exists()) {
              FileUtils.deleteDirectory(cacheDir);
          }
  
          OpearFile opearFile = new OpearFile(cacheDir,
                  new OpearFile.OpearMetadata(new String[0], new String[0], true));
  
          final ClassLoader parent = new URLClassLoader(new URL[0], null);
          assertSame("same classloader with empty classpath", parent, opearFile.getPlanClassLoader(parent));
      }
test_case.class_method_signature: OpearFileTest.testGetPlanClassLoader_empty()
test_case.full_signature: @Test public void testGetPlanClassLoader_empty()
test_case.identifier: testGetPlanClassLoader_empty
test_case.invocations: exists deleteDirectory assertSame getPlanClassLoader
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetPlanClassLoader_empty()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(OpearFile.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(OpearFile.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: NAME_BUNDLE_SYMBOLICNAME = new Attributes.Name(MF_BUNDLE_SYMBOLICNAME)
focal_class.modifier: public static final
focal_class.original_string: public static final Attributes.Name NAME_BUNDLE_SYMBOLICNAME = new Attributes.Name(MF_BUNDLE_SYMBOLICNAME);
focal_class.type: Attributes.Name
focal_class.var_name: NAME_BUNDLE_SYMBOLICNAME
focal_class.declarator: NAME_BUNDLE_VERSION = new Attributes.Name(MF_BUNDLE_VERSION)
focal_class.modifier: public static final
focal_class.original_string: public static final Attributes.Name NAME_BUNDLE_VERSION = new Attributes.Name(MF_BUNDLE_VERSION);
focal_class.type: Attributes.Name
focal_class.var_name: NAME_BUNDLE_VERSION
focal_class.declarator: NAME_CLASS_PATH = new Attributes.Name(MF_CLASS_PATH)
focal_class.modifier: public static final
focal_class.original_string: public static final Attributes.Name NAME_CLASS_PATH = new Attributes.Name(MF_CLASS_PATH);
focal_class.type: Attributes.Name
focal_class.var_name: NAME_CLASS_PATH
focal_class.declarator: NAME_OAKPAL_VERSION = new Attributes.Name(MF_OAKPAL_VERSION)
focal_class.modifier: public static final
focal_class.original_string: public static final Attributes.Name NAME_OAKPAL_VERSION = new Attributes.Name(MF_OAKPAL_VERSION);
focal_class.type: Attributes.Name
focal_class.var_name: NAME_OAKPAL_VERSION
focal_class.declarator: NAME_OAKPAL_PLAN = new Attributes.Name(MF_OAKPAL_PLAN)
focal_class.modifier: public static final
focal_class.original_string: public static final Attributes.Name NAME_OAKPAL_PLAN = new Attributes.Name(MF_OAKPAL_PLAN);
focal_class.type: Attributes.Name
focal_class.var_name: NAME_OAKPAL_PLAN
focal_class.declarator: cacheDir
focal_class.modifier: final
focal_class.original_string: final File cacheDir;
focal_class.type: File
focal_class.var_name: cacheDir
focal_class.declarator: metadata
focal_class.modifier: final
focal_class.original_string: final OpearMetadata metadata;
focal_class.type: OpearMetadata
focal_class.var_name: metadata
focal_class.file: core/src/main/java/net/adamcin/oakpal/core/opear/OpearFile.java
focal_class.identifier: OpearFile
focal_class.interfaces: implements Opear
focal_class.class_method_signature: OpearFile.OpearFile(final File cacheDir, final OpearMetadata metadata)
focal_class.full_signature:   OpearFile(final File cacheDir, final OpearMetadata metadata)
focal_class.identifier: OpearFile
focal_class.parameters: (final File cacheDir, final OpearMetadata metadata)
focal_class.signature:  OpearFile(final File cacheDir, final OpearMetadata metadata)
focal_class.class_method_signature: OpearFile.getDefaultPlan()
focal_class.full_signature: @Override public URL getDefaultPlan()
focal_class.identifier: getDefaultPlan
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: URL
focal_class.signature: URL getDefaultPlan()
focal_class.class_method_signature: OpearFile.getSpecificPlan(final @NotNull String planName)
focal_class.full_signature: @Override public Result<URL> getSpecificPlan(final @NotNull String planName)
focal_class.identifier: getSpecificPlan
focal_class.modifiers: @Override public
focal_class.parameters: (final @NotNull String planName)
focal_class.return: Result<URL>
focal_class.signature: Result<URL> getSpecificPlan(final @NotNull String planName)
focal_class.class_method_signature: OpearFile.getPlanClassLoader(final @NotNull ClassLoader parent)
focal_class.full_signature: @Override public ClassLoader getPlanClassLoader(final @NotNull ClassLoader parent)
focal_class.identifier: getPlanClassLoader
focal_class.modifiers: @Override public
focal_class.parameters: (final @NotNull ClassLoader parent)
focal_class.return: ClassLoader
focal_class.signature: ClassLoader getPlanClassLoader(final @NotNull ClassLoader parent)
focal_class.class_method_signature: OpearFile.readExpectedManifest(final @NotNull File mfFile)
focal_class.full_signature: static Result<Manifest> readExpectedManifest(final @NotNull File mfFile)
focal_class.identifier: readExpectedManifest
focal_class.modifiers: static
focal_class.parameters: (final @NotNull File mfFile)
focal_class.return: Result<Manifest>
focal_class.signature: Result<Manifest> readExpectedManifest(final @NotNull File mfFile)
focal_class.class_method_signature: OpearFile.metaForSimpleDir(final @NotNull File directory)
focal_class.full_signature: static OpearMetadata metaForSimpleDir(final @NotNull File directory)
focal_class.identifier: metaForSimpleDir
focal_class.modifiers: static
focal_class.parameters: (final @NotNull File directory)
focal_class.return: OpearMetadata
focal_class.signature: OpearMetadata metaForSimpleDir(final @NotNull File directory)
focal_class.class_method_signature: OpearFile.validateUriHeaderValuesWithDefaultForMissing(final @NotNull Manifest manifest,
                                                                           final @NotNull Attributes.Name headerName,
                                                                           final @NotNull String... defaultValue)
focal_class.full_signature: static Result<String[]> validateUriHeaderValuesWithDefaultForMissing(final @NotNull Manifest manifest,
                                                                           final @NotNull Attributes.Name headerName,
                                                                           final @NotNull String... defaultValue)
focal_class.identifier: validateUriHeaderValuesWithDefaultForMissing
focal_class.modifiers: static
focal_class.parameters: (final @NotNull Manifest manifest,
                                                                           final @NotNull Attributes.Name headerName,
                                                                           final @NotNull String... defaultValue)
focal_class.return: Result<String[]>
focal_class.signature: Result<String[]> validateUriHeaderValuesWithDefaultForMissing(final @NotNull Manifest manifest,
                                                                           final @NotNull Attributes.Name headerName,
                                                                           final @NotNull String... defaultValue)
focal_class.class_method_signature: OpearFile.validateUriHeaderValues(final @NotNull Manifest manifest,
                                                      final @NotNull Attributes.Name headerName)
focal_class.full_signature: static Result<String[]> validateUriHeaderValues(final @NotNull Manifest manifest,
                                                      final @NotNull Attributes.Name headerName)
focal_class.identifier: validateUriHeaderValues
focal_class.modifiers: static
focal_class.parameters: (final @NotNull Manifest manifest,
                                                      final @NotNull Attributes.Name headerName)
focal_class.return: Result<String[]>
focal_class.signature: Result<String[]> validateUriHeaderValues(final @NotNull Manifest manifest,
                                                      final @NotNull Attributes.Name headerName)
focal_class.class_method_signature: OpearFile.validateOpearManifest(final @Nullable Manifest manifest)
focal_class.full_signature: static Result<OpearMetadata> validateOpearManifest(final @Nullable Manifest manifest)
focal_class.identifier: validateOpearManifest
focal_class.modifiers: static
focal_class.parameters: (final @Nullable Manifest manifest)
focal_class.return: Result<OpearMetadata>
focal_class.signature: Result<OpearMetadata> validateOpearManifest(final @Nullable Manifest manifest)
focal_class.class_method_signature: OpearFile.fromDirectory(final @NotNull File directory)
focal_class.full_signature: public static Result<OpearFile> fromDirectory(final @NotNull File directory)
focal_class.identifier: fromDirectory
focal_class.modifiers: public static
focal_class.parameters: (final @NotNull File directory)
focal_class.return: Result<OpearFile>
focal_class.signature: Result<OpearFile> fromDirectory(final @NotNull File directory)
focal_class.class_method_signature: OpearFile.getHashCacheKey(final @NotNull String path)
focal_class.full_signature: static Result<String> getHashCacheKey(final @NotNull String path)
focal_class.identifier: getHashCacheKey
focal_class.modifiers: static
focal_class.parameters: (final @NotNull String path)
focal_class.return: Result<String>
focal_class.signature: Result<String> getHashCacheKey(final @NotNull String path)
focal_class.class_method_signature: OpearFile.fromJar(final @NotNull JarFile jarFile, final @NotNull File cacheBaseDir)
focal_class.full_signature: public static Result<OpearFile> fromJar(final @NotNull JarFile jarFile, final @NotNull File cacheBaseDir)
focal_class.identifier: fromJar
focal_class.modifiers: public static
focal_class.parameters: (final @NotNull JarFile jarFile, final @NotNull File cacheBaseDir)
focal_class.return: Result<OpearFile>
focal_class.signature: Result<OpearFile> fromJar(final @NotNull JarFile jarFile, final @NotNull File cacheBaseDir)
focal_class.class_method_signature: OpearFile.cacheJar(final @NotNull JarFile jarFile, final @NotNull File cacheDir)
focal_class.full_signature: static Result<File> cacheJar(final @NotNull JarFile jarFile, final @NotNull File cacheDir)
focal_class.identifier: cacheJar
focal_class.modifiers: static
focal_class.parameters: (final @NotNull JarFile jarFile, final @NotNull File cacheDir)
focal_class.return: Result<File>
focal_class.signature: Result<File> cacheJar(final @NotNull JarFile jarFile, final @NotNull File cacheDir)
focal_method.body: @Override
      public ClassLoader getPlanClassLoader(final @NotNull ClassLoader parent) {
          final URL[] urls = Stream.of(metadata.getPlanClassPath())
                  .map(name -> new File(cacheDir, name)).flatMap(file -> {
                      if (file.isDirectory() || file.getName().endsWith(".jar")) {
                          return compose1(File::toURI, result1(URI::toURL)).apply(file).stream();
                      } else {
                          return Stream.empty();
                      }
                  })
                  .toArray(URL[]::new);
  
          if (urls.length > 0) {
              return new URLClassLoader(urls, parent);
          } else {
              return parent;
          }
      }
focal_method.class_method_signature: OpearFile.getPlanClassLoader(final @NotNull ClassLoader parent)
focal_method.full_signature: @Override public ClassLoader getPlanClassLoader(final @NotNull ClassLoader parent)
focal_method.identifier: getPlanClassLoader
focal_method.invocations: toArray flatMap map of getPlanClassPath isDirectory endsWith getName stream apply compose1 result1 empty
focal_method.modifiers: @Override public
focal_method.parameters: (final @NotNull ClassLoader parent)
focal_method.return: ClassLoader
focal_method.signature: ClassLoader getPlanClassLoader(final @NotNull ClassLoader parent)