How to get the file name of the one being used by a inputStream?

java

Solution

I guess you cannot, because the input stream might not belong to a file. It can be `SocketInputStream`, or `ByteArrayInputStream` for example. The input stream is just an abstraction

Problem

I have a method accepts an InputStream as an argument. How do I find which file is being handled by the passed handler? For example: ``` public performSomething(InputStream inputStream) { System.out.println(FILENAME); } ``` What should the FILENAME be replaced with such that the name of the file opened by the handler is displayed.

Original source

Related problems