简体   繁体   中英

Java, JFileChooser & Windows Network Shares WITH Password Protection

I need to present to the user or my application a dialogue in which that point to a particular file so naturally the easiest choice is to use a JFileChooser.

However the file that needs to be selected is on a Windows network drive/share but it is mapped to a drive on the host computer running my app. The network share IS password and JFileChooser does present the drive in its dialoge but it cannot browse the drive until I use another program eg Windows Explorer to view the network share where it will ask for the password.

Is it possible for the JFileChooser to request the user for a password? Does JFileChooser receive notification from the system that password/authentication is required? Using the Sun example here , it just fails silently which is NOT what I want to happen. I want the user to be prompted for a password. Can I do this?

在这种情况下, PasswordAuthentication可能会派上用场。例子可以在这里找到

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM