pixelWorld
pixelWorld

Reputation: 399

Converting InputStream to File Object

I want to pass a File object while using loadKeyMaterial() api in Spring application. I am using a jar file to run my application, and have faced the problem when accessing the File directly in the jar. So, I am using InputStream to access the File from the Resources. How do I convert this InputStream to a File object for the loadKeyMaterial()?

Upvotes: 0

Views: 1234

Answers (1)

Jiri Tousek
Jiri Tousek

Reputation: 12450

You could use loadKeyMaterial() overload that uses KeyStore rather than File parameter. The KeyStore may be loaded from a stream, there's an example for that in KeyStore Javadoc.

Upvotes: 4

Related Questions