This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.0.x by this push:
new b2d13a1265 Fix PEM file lookup so it works with Ant and IDEs
b2d13a1265 is described below
commit b2d13a1265b4e20332f8e739ad66a303f890b9ae
Author: Mark Thomas <[email protected]>
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: [email protected]
For additional commands, e-mail: [email protected]