title: How can I access a file over the network (peer-to-peer, ex: a shared folder/file) in Java?
body: <p>I need to know how to access a file or folder over a network. Let's say I have a network called "work-server", and, of course, in order to access it, I would type "\\work-server\", followed by the folder or file I would like to access.</p>
  
  <p>Now, I know that I can use that filepath to access the file or folder. However, let's assume that someone installs my software application and has a different server name, titled "their-work-server". I don't know the name of this server. Therefore, it is not hard-coded into the software application.</p>
  
  <p>I would like to allow my software application to access the shared folder/network, without having to hard-code the server name and without requiring the user to enter the server name every time he or she runs the application.</p>
  
  <p>How might I go about this?</p>