You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2022/05/10 15:04:47 UTC

[tomcat] branch 8.5.x updated: Fix PEM file lookup so it works with Ant and IDEs

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new c28a437b85 Fix PEM file lookup so it works with Ant and IDEs
c28a437b85 is described below

commit c28a437b852641290294e6e22f7650051b15f079
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue May 10 15:50:39 2022 +0100

    Fix PEM file lookup so it works with Ant and IDEs
---
 test/org/apache/tomcat/util/net/jsse/TestPEMFile.java | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/test/org/apache/tomcat/util/net/jsse/TestPEMFile.java b/test/org/apache/tomcat/util/net/jsse/TestPEMFile.java
index 1be9419d58..620d16947e 100644
--- a/test/org/apache/tomcat/util/net/jsse/TestPEMFile.java
+++ b/test/org/apache/tomcat/util/net/jsse/TestPEMFile.java
@@ -18,9 +18,7 @@ package org.apache.tomcat.util.net.jsse;
 
 import java.io.File;
 import java.io.IOException;
-import java.net.URI;
 import java.net.URISyntaxException;
-import java.net.URL;
 import java.security.PrivateKey;
 
 import org.junit.Assert;
@@ -80,9 +78,9 @@ public class TestPEMFile {
 
 
     private String getPath(String file) throws URISyntaxException, IOException {
-        URL url = this.getClass().getResource(file);
-        URI uri = url.toURI();
-        File f = new File(uri);
+        String packageName = this.getClass().getPackageName();
+        String path = packageName.replaceAll("\\.", File.separator);
+        File f = new File("test" + File.separator + path + File.separator + file);
 
         return f.getCanonicalPath();
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org