简体   繁体   中英

How to get the UNC path of a mapped network drive in a Java application

I'm trying to find a way to access the UNC path of a mapped network drive in my Java application.

Basically I'm saving the full path of a file that the user browses for and chooses. However, I don't want my saved path to include "J:\\" and similar letters in the beginning of the path but instead the full mapped network path. How can I access that?

I have been using FileDialog to browse and choose the file but I can change that if I need to.

Thank you

Answer taken from the following link:

How to retrieve the UNC path instead of mapped drive path from JFileChooser

The answer was edited into the question.

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