You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@bookkeeper.apache.org by GitBox <gi...@apache.org> on 2018/01/29 21:24:57 UTC

[GitHub] sijie commented on a change in pull request #1074: URLDecode key/cert paths in TestTLS

sijie commented on a change in pull request #1074: URLDecode key/cert paths in TestTLS
URL: https://github.com/apache/bookkeeper/pull/1074#discussion_r164565989
 
 

 ##########
 File path: bookkeeper-server/src/test/java/org/apache/bookkeeper/tls/TestTLS.java
 ##########
 @@ -99,6 +101,10 @@ public TestTLS(String keyStoreFormat, String trustStoreFormat) {
         this.serverTrustStoreFormat = TLSContextFactory.KeyStoreType.valueOf(trustStoreFormat);
     }
 
+    private String getResourcePath(String resource) throws Exception {
+        return URLDecoder.decode(this.getClass().getClassLoader().getResource(resource).getPath(), UTF_8.name());
 
 Review comment:
   I think it is probably better to use `toURI().getPath()`, rather than us doing the magic decoding. 
   
   [URI.getPath](https://docs.oracle.com/javase/7/docs/api/java/net/URI.html#getPath())

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services