title: Java - How to list files on mapped network drive?
body: <p>Im trying to connect to a mapped drive (sharepoint) to make a list of the files that exists.</p>
  
  <p>So, I have this code that works fine on listing the files on my local PC:</p>
  
  <pre><code>public static void main(String[] args) {
      // Directory path here
      String path = "/"; 
  
      String files;
      File folder = new File(path);
      File[] listOfFiles = folder.listFiles(); 
  
      for(int i = 0; i &lt; listOfFiles.length; i++){
          if(listOfFiles[i].isFile()){
              files = listOfFiles[i].getName();
              System.out.println(files);
          }
      }
  }
  </code></pre>
  
  <p>When path = "/", it displays all the files on my local drive C:. Now I would like to know if there is a way to adapt this to list the files of a mapped network drive (mapped as Y: for example).</p>