How to use a file in a jar as javax.net.ssl.keystore?

后端 未结 3 783
渐次进展
渐次进展 2020-12-01 08:13

I\'m trying to do something like

URL clientks = com.messaging.SubscriptionManager.class.getResource( \"client.ks\" );
String path = clientks.toURI().getPath         


        
3条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-01 08:48

    You can get an InputStream to a resource in a jar file, but not a File. If the "thing" that ultimately reads the keystore expects a File or a path to a file, your only option is to extract it to the filesystem.

提交回复
热议问题