Implement java.io.Closeable in PowerShell class
Suggestion: Implement java.io.Closeable in the PowerShell class to allow Java 7+ users to automatically close the powershell session with a try-with-resources statement.
Hello,
Thanks for this smart suggestion. For the moment I would like to keep it compatible with Java 5+. Maybe in a future 2.0 version.
Best regards
java.io.Closeable is available since Java 5 so it won't break compatibility. Only Java 7+ users can take advantage of the try-with-resources statement, but Java 5 users can still use this library the same way as before.
Ups!, I forgot to add this to 2.0 version, sorry. I will include it in 2.1
@profesorfalken Thanks for your share , the autoCloseable was enabled in 2.1 , one more question , Can we close PowerShell session manually?
Hi @LonnccGitHub ,
Yes of course. You can call manually the method close()
Best regards