I need to fetch a file from network, and save the associated file path using UNC convention. And I need to import data from that file (say Excel sheet) later at particular t
No problem. The UNC convention is without drive letters (C:, D:) in the format
\ \ COMPUTER \ DIR \ DIR \ FILE.
In Java suffices File file = new File("//COMPUTER/DIR/DIR/FILE") or "\ \ \ \ COMPUTER \ \ DIR \ \ DIR \ \ FILE". (I added extraneous spaces around the backslashes.)
file.getPath() will always yield backslashes (Windows).
For the computer name you can use getHostName(), see: http://www.rgagnon.com/javadetails/java-0390.html