0

how can I open a directory with Java which is password protected and then access files from this directory (in Windows)?

I want to open a folder (Test )in Network folder (Z://), in Windows. But I need a password to open the Network folder (Z://Test). Is it possible to write a programm in java? In the folder "Test" are data which I want to show in console

Thanks for your help!

LostInTranslate
  • 93
  • 1
  • 2
  • 11
  • what do you mean password protected? Windows or linux? Do you use an application to password protect your folder? Please be more specific – MaVRoSCy Jul 25 '17 at 06:58
  • I want to open a folder (Test )in Network folder (Z://), in Windows. But I need a password to open the Network folder (Z://Test). Is it possible to write a programm in java? In the folder "Test" are data which I want to show in console – LostInTranslate Jul 25 '17 at 07:05
  • You still did not answer the main question. What type of mechanism is used to password protect the file? Is it using windows domain user auth or by using any third party application? – MaVRoSCy Jul 25 '17 at 07:32
  • I think it is using windows domain user auth, but I have no idea where I can see this...it is a directory which are connected with wd mycloud and are just locally connected with the pc – LostInTranslate Jul 25 '17 at 08:20

1 Answers1

0

Windows normally uses Samba for their network shares so you need a Samba library. The most used one is probably JCIFS. If you're looking for a more active library smbj looks promising.

To see how you should use it JCIFS, see this answer. For smbj look at recent examples in the link provided.

SkryptX
  • 813
  • 1
  • 9
  • 24
  • String url = "smb://yourhost/yourpath/";, What does yourhost mean hear? – LostInTranslate Jul 25 '17 at 09:10
  • There you should fill in your file share address. This would be the address that you connected to your "Z" network share in the first place. The java solution skips the "Windows part" and directly connects with the file share server and gets the information directly. – SkryptX Jul 25 '17 at 09:26