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 testValidateUriHeaderValues() {
          final Manifest manifest = new Manifest();
          manifest.getMainAttributes().put(NAME_CLASS_PATH, "../somedir");
          assertTrue(".. should fail",
                  OpearFile.validateUriHeaderValues(manifest, NAME_CLASS_PATH).isFailure());
          manifest.getMainAttributes().put(NAME_CLASS_PATH, "/somedir");
          assertTrue("/ should succeed",
                  OpearFile.validateUriHeaderValues(manifest, NAME_CLASS_PATH).isSuccess());
          manifest.getMainAttributes().put(NAME_CLASS_PATH, "/somedir/../..");
          assertTrue("/../.. should fail",
                  OpearFile.validateUriHeaderValues(manifest, NAME_CLASS_PATH).isFailure());
      }
test_case.class_method_signature: OpearFileTest.testValidateUriHeaderValues()
test_case.full_signature: @Test public void testValidateUriHeaderValues()
test_case.identifier: testValidateUriHeaderValues
test_case.invocations: put getMainAttributes assertTrue isFailure validateUriHeaderValues put getMainAttributes assertTrue isSuccess validateUriHeaderValues put getMainAttributes assertTrue isFailure validateUriHeaderValues
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testValidateUriHeaderValues()
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: static Result<String[]> validateUriHeaderValues(final @NotNull Manifest manifest,
                                                      final @NotNull Attributes.Name headerName) {
  
          final List<Result<String>> cpResult = Util.getManifestHeaderValues(manifest, headerName.toString())
                  .stream()
                  .map(result1(URI::new))
                  .map(uriResult -> uriResult.flatMap(uri -> {
                      final String normal = uri.normalize().getPath().replaceFirst("^/", "");
                      if ("..".equals(normal) || normal.startsWith("../")) {
                          return Result.failure("Illegal parent path selector in " + normal);
                      } else {
                          return Result.success(normal);
                      }
                  }))
                  .collect(Collectors.toList());
          return cpResult.stream()
                  .filter(Result::isFailure).findFirst()
                  .map(failed ->
                          failed.getError()
                                  .map(Result::<String[]>failure)
                                  .orElseGet(() -> Result.<String[]>failure(format("invalid %s header", headerName))))
                  .orElseGet(() -> Result.success(cpResult.stream().flatMap(Result::stream).toArray(String[]::new)));
      }
focal_method.class_method_signature: OpearFile.validateUriHeaderValues(final @NotNull Manifest manifest,
                                                      final @NotNull Attributes.Name headerName)
focal_method.full_signature: static Result<String[]> validateUriHeaderValues(final @NotNull Manifest manifest,
                                                      final @NotNull Attributes.Name headerName)
focal_method.identifier: validateUriHeaderValues
focal_method.invocations: collect map map stream getManifestHeaderValues toString result1 flatMap replaceFirst getPath normalize equals startsWith failure success toList orElseGet map findFirst filter stream orElseGet map getError failure format success toArray flatMap stream
focal_method.modifiers: static
focal_method.parameters: (final @NotNull Manifest manifest,
                                                      final @NotNull Attributes.Name headerName)
focal_method.return: Result<String[]>
focal_method.signature: Result<String[]> validateUriHeaderValues(final @NotNull Manifest manifest,
                                                      final @NotNull Attributes.Name headerName)