0

Is it any way to get the sun.nio.fs library as a public library? in OpenJDK it is private. Especially I need WindowsSecurity class, but the whole thing looks very useful to me. Of cause I've looked in Google.

  • 2
    Why specifically do you need the utility of that specific class? What are you trying to achieve? Most of these 'platform specific' mechanisms are exposed by publically accessible wrapperclasses – n247s Jul 07 '20 at 12:53
  • That is the problem that I can not find a wrapper class. I need to connect to remote machine with administrative rights and copy all the files from there. –  Jul 07 '20 at 13:12
  • Can this Thread be of use? https://stackoverflow.com/questions/19037339/run-java-file-as-administrator-with-full-privileges – n247s Jul 07 '20 at 21:39
  • This thread is very useful in the way as I defined the problem here, but I needed "in code" solution. –  Jul 09 '20 at 12:05
  • Ahh right, I thougt [this answer](https://stackoverflow.com/a/29918826/5231001) provided an 'in code' solution. But if that doesn't suit your needs, you'll need to look further I'm afraid. – n247s Jul 09 '20 at 18:32
  • Actually I accidentally find the answer below. But I appreciate your help. –  Jul 10 '20 at 21:36

1 Answers1

0

The solution to my problem is to use com.sun.jna.platform.win32.WinNT.Privilage class that wraps the same Win Kernel commands as WindowsSecurity class does.