test_class.declarator: folder = new TemporaryFolder()
test_class.modifier: @Rule
    public
test_class.original_string: @Rule
    public TemporaryFolder folder = new TemporaryFolder();
test_class.type: TemporaryFolder
test_class.var_name: folder
test_class.file: outland-feature-java/src/test/java/outland/feature/CertificateLoaderTest.java
test_class.identifier: CertificateLoaderTest
test_case.body: @Test
    public void resolvePath() throws IOException {
      try {
        CertificateLoader.resolvePath("classpath:cer");
        fail("exception expected for unknown classpath");
      } catch (Exception ignored) {
      }
  
      try {
        CertificateLoader.resolvePath("file://woo");
        fail("exception expected for file uri component");
      } catch (Exception ignored) {
      }
  
      try {
        CertificateLoader.resolvePath("file:///woo");
        fail("exception expected for missing path");
      } catch (Exception ignored) {
      }
  
      Path pathC = CertificateLoader.resolvePath("classpath:certs");
      assertTrue(pathC != null);
  
      String fPath = "file://" + folder.newFolder().getAbsolutePath();
      Path pathF = CertificateLoader.resolvePath(fPath);
      assertTrue(pathF != null);
    }
test_case.class_method_signature: CertificateLoaderTest.resolvePath()
test_case.full_signature: @Test public void resolvePath()
test_case.identifier: resolvePath
test_case.invocations: resolvePath fail resolvePath fail resolvePath fail resolvePath assertTrue getAbsolutePath newFolder resolvePath assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void resolvePath()
focal_class.declarator: logger = LoggerFactory.getLogger("FeatureClient")
focal_class.modifier: private static final
focal_class.original_string: private static final Logger logger = LoggerFactory.getLogger("FeatureClient");
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: certificatePath
focal_class.modifier: private final
focal_class.original_string: private final String certificatePath;
focal_class.type: String
focal_class.var_name: certificatePath
focal_class.declarator: sslContext
focal_class.modifier: private
focal_class.original_string: private SSLContext sslContext;
focal_class.type: SSLContext
focal_class.var_name: sslContext
focal_class.declarator: trustManager
focal_class.modifier: private
focal_class.original_string: private X509TrustManager trustManager;
focal_class.type: X509TrustManager
focal_class.var_name: trustManager
focal_class.file: outland-feature-java/src/main/java/outland/feature/CertificateLoader.java
focal_class.identifier: CertificateLoader
focal_class.class_method_signature: CertificateLoader.CertificateLoader(String certificatePath)
focal_class.full_signature:   CertificateLoader(String certificatePath)
focal_class.identifier: CertificateLoader
focal_class.parameters: (String certificatePath)
focal_class.signature:  CertificateLoader(String certificatePath)
focal_class.class_method_signature: CertificateLoader.getResourceUrl(String resourceName)
focal_class.full_signature: private static URL getResourceUrl(String resourceName)
focal_class.identifier: getResourceUrl
focal_class.modifiers: private static
focal_class.parameters: (String resourceName)
focal_class.return: URL
focal_class.signature: URL getResourceUrl(String resourceName)
focal_class.class_method_signature: CertificateLoader.resolvePath(String certificatePath)
focal_class.full_signature: @VisibleForTesting static Path resolvePath(String certificatePath)
focal_class.identifier: resolvePath
focal_class.modifiers: @VisibleForTesting static
focal_class.parameters: (String certificatePath)
focal_class.return: Path
focal_class.signature: Path resolvePath(String certificatePath)
focal_class.class_method_signature: CertificateLoader.applySslSocketFactory(OkHttpClient.Builder builder)
focal_class.full_signature:  void applySslSocketFactory(OkHttpClient.Builder builder)
focal_class.identifier: applySslSocketFactory
focal_class.parameters: (OkHttpClient.Builder builder)
focal_class.return: void
focal_class.signature: void applySslSocketFactory(OkHttpClient.Builder builder)
focal_class.class_method_signature: CertificateLoader.create(String certificatePath)
focal_class.full_signature: private void create(String certificatePath)
focal_class.identifier: create
focal_class.modifiers: private
focal_class.parameters: (String certificatePath)
focal_class.return: void
focal_class.signature: void create(String certificatePath)
focal_class.class_method_signature: CertificateLoader.create(Path path)
focal_class.full_signature: private void create(Path path)
focal_class.identifier: create
focal_class.modifiers: private
focal_class.parameters: (Path path)
focal_class.return: void
focal_class.signature: void create(Path path)
focal_class.class_method_signature: CertificateLoader.installCertificates(Path path, KeyStore keyStore)
focal_class.full_signature: private void installCertificates(Path path, KeyStore keyStore)
focal_class.identifier: installCertificates
focal_class.modifiers: private
focal_class.parameters: (Path path, KeyStore keyStore)
focal_class.return: void
focal_class.signature: void installCertificates(Path path, KeyStore keyStore)
focal_class.class_method_signature: CertificateLoader.sslContext()
focal_class.full_signature:  SSLContext sslContext()
focal_class.identifier: sslContext
focal_class.parameters: ()
focal_class.return: SSLContext
focal_class.signature: SSLContext sslContext()
focal_class.class_method_signature: CertificateLoader.trustManager()
focal_class.full_signature:  X509TrustManager trustManager()
focal_class.identifier: trustManager
focal_class.parameters: ()
focal_class.return: X509TrustManager
focal_class.signature: X509TrustManager trustManager()
focal_method.body: @VisibleForTesting
    static Path resolvePath(String certificatePath) {
      Path path;
      if (certificatePath.startsWith("file:")) {
        try {
          logger.info("using file resolver for {}", certificatePath);
          path = Paths.get(new URL(certificatePath).toURI());
          if (!Files.exists(path)) {
            throw new FileNotFoundException();
          }
          return path;
        } catch (Exception e) {
          throw new FeatureException(
              Problem.localProblem("certificatePath resolver failed " + certificatePath,
                  e.getMessage()), e);
        }
      }
  
      if (certificatePath.startsWith("classpath:")) {
        logger.info("using classpath resolver for {}", certificatePath);
        String resource = getResourceUrl(
            certificatePath.substring("classpath:".length(), certificatePath.length())).getPath();
        return Paths.get(resource);
      }
  
      throw new FeatureException(
          Problem.localProblem(
              "certificatePath must start with file: or classpath: " + certificatePath, ""));
    }
focal_method.class_method_signature: CertificateLoader.resolvePath(String certificatePath)
focal_method.full_signature: @VisibleForTesting static Path resolvePath(String certificatePath)
focal_method.identifier: resolvePath
focal_method.invocations: startsWith info get toURI exists localProblem getMessage startsWith info getPath getResourceUrl substring length length get localProblem
focal_method.modifiers: @VisibleForTesting static
focal_method.parameters: (String certificatePath)
focal_method.return: Path
focal_method.signature: Path resolvePath(String certificatePath)