Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Apache Ftp检索文件未下载大文件_Java_Apache_Ftp_Apache Commons_Apache Commons Net - Fatal编程技术网

Java Apache Ftp检索文件未下载大文件

Java Apache Ftp检索文件未下载大文件,java,apache,ftp,apache-commons,apache-commons-net,Java,Apache,Ftp,Apache Commons,Apache Commons Net,我试图检索大小为1 GB的文件(.dat),但是,从服务器检索一些字节后,它显示没有Ftp连接服务器,但是,该程序不会抛出错误并挂起,我的代码对于小文件运行得很好,但是对于大文件它失败 代码如下 //Ftp Connection ftpClient.connect(server, port); ftpClient.login(username, password); ftpClient.enterLocalPassiveMode(); ftpClient.setFileType(

我试图检索大小为1 GB的文件(.dat),但是,从服务器检索一些字节后,它显示没有Ftp连接服务器,但是,该程序不会抛出错误并挂起,我的代码对于小文件运行得很好,但是对于大文件它失败
代码如下

//Ftp Connection  
ftpClient.connect(server, port);  
ftpClient.login(username, password);  
ftpClient.enterLocalPassiveMode();  
ftpClient.setFileType(FTP.BINARY_FILE_TYPE);

//File Downloading
File downloadFile = new File(savePath);
OutputStream outputStream = new BufferedOutputStream(new FileOutputStream(downloadFile));
isFileDownloaded= ftpClient.retrieveFile(remoteFilePath, outputStream);`