title: Get hidden files in FTP server
body: <p>I have the local server mockftpserver, and in the server there are couple of files and they are protected with a prefix '._' and the method to protect from getting those files is the following  : </p>
  
  <pre><code>protected String getRealPath(Session session, String path) {
      String currentDirectory = (String) session.getAttribute(SessionKeys.CURRENT_DIRECTORY);
      String result;
      if (path == null) {
          result = currentDirectory;
      }
      else if (getFileSystem().isAbsolute(path)) {
          result = path;
      }
      else {
          result = getFileSystem().path(currentDirectory, path);
      }
      return result.replace("._", "");
  }
  </code></pre>
  
  <p>I tried to list the files in the FTP server I got them but the protected ones like '._passwrd' I was not able to see it. 
  I used the normal method to get the file list:</p>
  
  <pre><code>boolean login = ftpClient.login("user", "password"); 
  
  if (login) {  
      System.out.println("Connection established...");  
      FTPFile[] files = ftpClient.listFiles();  
  
      for (FTPFile file : files) {  
          if (file.getType() == FTPFile.FILE_TYPE) {  
              System.out.println("File Name: "  
              + file.getName()  
              + " File Size: " );  
          }  
      }  
      String[] fil = ftpClient.listNames();
      if (files != null &amp;&amp; fil.length &gt; 0) {
          for (String aFile: fil) {
              System.out.println(aFile);
          }
      }
      BufferedReader reader = null;
      String firstLine = null;
  
      try {
          InputStream stream = 
              ftpClient.retrieveFileStream("._"+"._passwd");
          reader = new BufferedReader(new InputStreamReader(stream, "UTF-8"));
          firstLine = reader.readLine();
      } finally {
          if (reader != null) 
              try { 
                  reader.close(); 
              } catch (IOException logOrIgnore) {}
      }
  }
  </code></pre>
  
  <p>But thinking that the method will only check the name once, so if I added the ._ once again it should work. Although it did not or I could not apply it in the right way. </p>