title: fetch data from ftp://ftp.funet.fi/pub/mirrors/ftp.imdb.com/pub/ using java
body: <p><a href="https://i.stack.imgur.com/VF5rx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VF5rx.png" alt="Error what i am getting"></a>how can I fetch movie.list.gz folder from the link 
      <a href="https://i.stack.imgur.com/VF5rx.png" rel="nofollow noreferrer">1</a>: <a href="ftp://ftp.funet.fi/pub/mirrors/ftp.imdb.com/pub/" rel="nofollow noreferrer">ftp://ftp.funet.fi/pub/mirrors/ftp.imdb.com/pub/</a>, I have used a code to access the FTP server for fetching data but it asks for port no. which I don't know. Can anyone please tell how to fetch data from the above link in java. I am developing a Web Application which will display all the movie names present in IMDB database.</p>
  
  <p>CODE:</p>
  
  <pre><code> String server = "ftp://ftp.funet.fi/pub/mirrors/ftp.imdb.com";
      int port = 21;
  
  
      FTPClient ftpClient = new FTPClient();
      try {
  
          ftpClient.connect(server);
  
          ftpClient.enterLocalPassiveMode();
          ftpClient.setFileType(FTP.BINARY_FILE_TYPE);
  
          // APPROACH #1: using retrieveFile(String, OutputStream)
          String remoteFile1 = "/pub/movie.list.gz";
          File downloadFile1 = new File("F:/softwares/mov.list.gz");
          OutputStream outputStream1 = new BufferedOutputStream(new FileOutputStream(downloadFile1));
          boolean success = ftpClient.retrieveFile(remoteFile1, outputStream1);
          outputStream1.close();
  
          if (success) {
              System.out.println("File #1 has been downloaded successfully.");
          }
  
  
      } catch (IOException ex) {
          System.out.println("Error: " + ex.getMessage());
          ex.printStackTrace();
      } finally {
          try {
              if (ftpClient.isConnected()) {
                  ftpClient.logout();
                  ftpClient.disconnect();
              }
          } catch (IOException ex) {
              ex.printStackTrace();
          }
      }
  }
  </code></pre>